Skip to content

Commit

Permalink
✅ Fixed broken unit tests
Browse files Browse the repository at this point in the history
Removed logging labels hardcoded in expected message strings
  • Loading branch information
mkarlesky committed May 1, 2024
1 parent af0ef22 commit 64ce6ff
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions spec/file_finder_helper_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,13 @@
end

it 'outputs a complaint if complain is warn' do
msg = 'WARNING: Found no file `d.c` in search paths.'
msg = 'Found no file `d.c` in search paths.'
expect(@streaminator).to receive(:stream_puts).with(msg, Verbosity::COMPLAIN)
@ff_helper.find_file_in_collection('d.c', FILE_LIST, :warn)
end

it 'outputs and raises an error if complain is error' do
msg = 'ERROR: Found no file `d.c` in search paths.'
msg = 'Found no file `d.c` in search paths.'
allow(@streaminator).to receive(:stream_puts).with(msg, Verbosity::ERRORS) do
expect{@ff_helper.find_file_in_collection('d.c', FILE_LIST, :warn)}.to raise_error
end
Expand Down
4 changes: 2 additions & 2 deletions spec/tool_executor_helper_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,14 @@
"\n".freeze

ERROR_OUTPUT =
"ERROR: Shell command failed.\n" +
"Shell command failed.\n" +
"> Shell executed command:\n" +
"'gcc ab.c'\n" +
"> And exited with status: [1].\n" +
"\n"

ERROR_OUTPUT_WITH_MESSAGE =
"ERROR: Shell command failed.\n" +
"Shell command failed.\n" +
"> Shell executed command:\n" +
"'gcc ab.c'\n" +
"> Produced output:\n" +
Expand Down

0 comments on commit 64ce6ff

Please sign in to comment.