Skip to content

Commit

Permalink
✅ Fixed broken tests with proper loginator
Browse files Browse the repository at this point in the history
  • Loading branch information
mkarlesky committed May 1, 2024
1 parent 78652f6 commit d9cb5e3
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion spec/file_finder_helper_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
describe FileFinderHelper do
before(:each) do
# this will always be mocked
@loginator = loginator.new({:verbosinator => nil, :file_wrapper => nil, :system_wrapper => nil, :stream_wrapper => nil})
@loginator = Loginator.new({:verbosinator => nil, :file_wrapper => nil, :system_wrapper => nil, :stream_wrapper => nil})

@ff_helper = described_class.new({:loginator => @loginator})
end
Expand Down
2 changes: 1 addition & 1 deletion spec/generator_test_results_sanity_checker_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
before(:each) do
# this will always be mocked
@configurator = Configurator.new({:configurator_setup => nil, :configurator_builder => nil, :configurator_plugins => nil, :yaml_wrapper => nil, :system_wrapper => nil})
@loginator = loginator.new({:verbosinator => nil, :file_wrapper => nil, :system_wrapper => nil, :stream_wrapper => nil})
@loginator = Loginator.new({:verbosinator => nil, :file_wrapper => nil, :system_wrapper => nil, :stream_wrapper => nil})

@sanity_checker = described_class.new({:configurator => @configurator, :loginator => @loginator})

Expand Down
2 changes: 1 addition & 1 deletion spec/generator_test_results_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
before(:each) do
# these will always be mocked
@configurator = Configurator.new({:configurator_setup => nil, :configurator_builder => nil, :configurator_plugins => nil, :yaml_wrapper => nil, :system_wrapper => nil})
@loginator = loginator.new({:verbosinator => nil, :file_wrapper => nil, :system_wrapper => nil, :stream_wrapper => nil})
@loginator = Loginator.new({:verbosinator => nil, :file_wrapper => nil, :system_wrapper => nil, :stream_wrapper => nil})

# these will always be used as is.
@yaml_wrapper = YamlWrapper.new
Expand Down
18 changes: 9 additions & 9 deletions spec/tool_executor_helper_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,12 @@
describe ToolExecutorHelper do
before(:each) do
# these will always be mocked
@sys_wraper = SystemWrapper.new
@sys_utils = SystemUtils.new({:system_wrapper => @sys_wraper})
@loginator = loginator.new({:verbosinator => nil, :file_wrapper => nil, :system_wrapper => nil, :stream_wrapper => @sys_wraper})
@sys_wrapper = SystemWrapper.new
@sys_utils = SystemUtils.new({:system_wrapper => @sys_wrapper})
@loginator = Loginator.new({:verbosinator => nil, :file_wrapper => nil, :system_wrapper => nil, :stream_wrapper => nil})


@tool_exe_helper = described_class.new({:loginator => @loginator, :system_utils => @sys_utils, :system_wrapper => @sys_wraper})
@tool_exe_helper = described_class.new({:loginator => @loginator, :system_utils => @sys_utils, :system_wrapper => @sys_wrapper})
end


Expand All @@ -85,13 +85,13 @@
describe '#osify_path_separators' do
it 'returns path if system is not windows' do
exe = '/just/some/executable.out'
expect(@sys_wraper).to receive(:windows?).and_return(false)
expect(@sys_wrapper).to receive(:windows?).and_return(false)
expect(@tool_exe_helper.osify_path_separators(exe)).to eq(exe)
end

it 'returns modifed if system is windows' do
exe = '/just/some/executable.exe'
expect(@sys_wraper).to receive(:windows?).and_return(true)
expect(@sys_wrapper).to receive(:windows?).and_return(true)
expect(@tool_exe_helper.osify_path_separators(exe)).to eq("\\just\\some\\executable.exe")
end
end
Expand Down Expand Up @@ -119,18 +119,18 @@


it 'returns "2>&1" if system is windows' do
expect(@sys_wraper).to receive(:windows?).and_return(true)
expect(@sys_wrapper).to receive(:windows?).and_return(true)
expect(@tool_exe_helper.stderr_redirect_cmdline_append(@tool_config)).to eq('2>&1')
end

it 'returns "|&" if system is tcsh' do
expect(@sys_wraper).to receive(:windows?).and_return(false)
expect(@sys_wrapper).to receive(:windows?).and_return(false)
expect(@sys_utils).to receive(:tcsh_shell?).and_return(true)
expect(@tool_exe_helper.stderr_redirect_cmdline_append(@tool_config)).to eq('|&')
end

it 'returns "2>&1" if system is unix' do
expect(@sys_wraper).to receive(:windows?).and_return(false)
expect(@sys_wrapper).to receive(:windows?).and_return(false)
expect(@sys_utils).to receive(:tcsh_shell?).and_return(false)
expect(@tool_exe_helper.stderr_redirect_cmdline_append(@tool_config)).to eq('2>&1')
end
Expand Down

0 comments on commit d9cb5e3

Please sign in to comment.