Change the level of failure in the runner

This commit is contained in:
Vitalii Elenhaupt 2019-04-14 15:57:48 +03:00
parent f6a57f9272
commit 575fe07879
No known key found for this signature in database
GPG key ID: 7558EF3A4056C706
5 changed files with 55 additions and 10 deletions

View file

@ -114,6 +114,29 @@ module Ameba::Cli
end
end
context "--fail-level" do
it "configures fail level Refactoring" do
c = Cli.parse_args %w(--fail-level refactoring)
c.fail_level.should eq Severity::Refactoring
end
it "configures fail level Warning" do
c = Cli.parse_args %w(--fail-level Warning)
c.fail_level.should eq Severity::Warning
end
it "configures fail level Error" do
c = Cli.parse_args %w(--fail-level error)
c.fail_level.should eq Severity::Error
end
it "raises if fail level is incorrect" do
expect_raises(Exception, "Incorrect severity name JohnDoe") do
Cli.parse_args %w(--fail-level JohnDoe)
end
end
end
it "accepts unknown args as globs" do
c = Cli.parse_args %w(source1.cr source2.cr)
c.globs.should eq %w(source1.cr source2.cr)