diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-06-23 01:41:33 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-06-23 01:41:33 +0900 |
| commit | 421d98d9a52dd036acd5632f9049f4503c9add18 (patch) | |
| tree | 578d4bc15a7cb01a591393df85d0b9cdfd7d6ea2 /crates/shirabe/tests/util/process_executor_test.rs | |
| parent | 894764ecb04f9c456b9ebda77d155bf6128e2175 (diff) | |
| download | php-shirabe-421d98d9a52dd036acd5632f9049f4503c9add18.tar.gz php-shirabe-421d98d9a52dd036acd5632f9049f4503c9add18.tar.zst php-shirabe-421d98d9a52dd036acd5632f9049f4503c9add18.zip | |
refactor(io): hold QuestionHelper directly in ConsoleIO instead of HelperSet
Every ConsoleIO construction site only ever registers a single QuestionHelper
(production) or none (tests), and routing asks through HelperSet::get('question')
loses the concrete type, forcing a downcast back to QuestionHelper. Receive the
QuestionHelper in the constructor and hold it directly (in a RefCell, since
QuestionHelper::ask takes &mut self while the IOInterfaceImmutable ask methods are
&self), dropping the HelperSet field and the throwaway HelperSet built at each
call site.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Diffstat (limited to 'crates/shirabe/tests/util/process_executor_test.rs')
| -rw-r--r-- | crates/shirabe/tests/util/process_executor_test.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/crates/shirabe/tests/util/process_executor_test.rs b/crates/shirabe/tests/util/process_executor_test.rs index e5ee7c2..0416a34 100644 --- a/crates/shirabe/tests/util/process_executor_test.rs +++ b/crates/shirabe/tests/util/process_executor_test.rs @@ -11,7 +11,7 @@ use shirabe::io::ConsoleIO; use shirabe::io::IOInterface; use shirabe::io::buffer_io::BufferIO; use shirabe::util::process_executor::ProcessExecutor; -use shirabe_external_packages::symfony::console::helper::HelperSet; +use shirabe_external_packages::symfony::console::helper::QuestionHelper; use shirabe_external_packages::symfony::console::input::array_input::ArrayInput; use shirabe_external_packages::symfony::console::input::input_interface::InputInterface; use shirabe_external_packages::symfony::console::output::buffered_output::BufferedOutput; @@ -143,7 +143,7 @@ fn test_console_io_does_not_format_symfony_console_style() { let console_io = ConsoleIO::new( input, output.clone() as Rc<RefCell<dyn OutputInterface>>, - HelperSet::default(), + QuestionHelper::default(), ); let mut process = ProcessExecutor::new(Some( Rc::new(RefCell::new(console_io)) as Rc<RefCell<dyn IOInterface>> |
