Skip to content

Commit

Permalink
Rescue SystemExit by assert_raise
Browse files Browse the repository at this point in the history
Because `exit(false)` raises SystemExit.
  • Loading branch information
okkez committed Feb 10, 2017
1 parent 67d73e0 commit ecf5fa5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion test/command/test_plugin_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,9 @@ class TestFluentPluginGenerator < Test::Unit::TestCase

test "unknown license" do
out = capture_stdout do
FluentPluginGenerator.new(["--license=unknown", "filter", "fake"]).call
assert_raise(SystemExit) do
FluentPluginGenerator.new(["--license=unknown", "filter", "fake"]).call
end
end
assert { out.lines.include?("License: unknown\n") }
end
Expand Down

0 comments on commit ecf5fa5

Please sign in to comment.