Skip to content

Commit

Permalink
Merge pull request #59 from nobu/abort-messages
Browse files Browse the repository at this point in the history
Suppress aborting message from tests
  • Loading branch information
yui-knk authored Jul 31, 2023
2 parents 5ce0e39 + 35c31dc commit d23b6f8
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions spec/lrama/command_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,21 @@
describe "a grammar file isn't specified" do
it "returns stderr" do
command = Lrama::Command.new([])
message = "File should be specified\n"
allow(STDERR).to receive(:write).with(message)
expect{ command.run }.to raise_error(SystemExit) do |e|
expect(e.message).to eq("File should be specified\n")
expect(e.message).to eq(message)
end
end
end

describe "STDIN mode, but a grammar file isn't specified" do
it "returns stderr" do
command = Lrama::Command.new(["-"])
message = "File name for STDIN should be specified\n"
allow(STDERR).to receive(:write).with(message)
expect{ command.run }.to raise_error(SystemExit) do |e|
expect(e.message).to eq("File name for STDIN should be specified\n")
expect(e.message).to eq(message)
end
end
end
Expand Down

0 comments on commit d23b6f8

Please sign in to comment.