Merge branch 'master' into 388-raise-on-invalid-file-path

This commit is contained in:
Stuart Frost 2023-07-26 15:22:04 +01:00 committed by GitHub
commit 07aebfc84a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 3 deletions

View file

@ -2,7 +2,7 @@ require "../spec_helper"
module Ameba
describe Config do
config_sample = "config/ameba.yml"
config_sample = "spec/fixtures/config.yml"
it "should have a list of available formatters" do
Config::AVAILABLE_FORMATTERS.should_not be_nil
@ -84,6 +84,12 @@ module Ameba
config.formatter.should_not be_nil
end
it "raises when custom config file doesn't exist" do
expect_raises(Exception, "Unable to load config file: Config file does not exist foo.yml") do
Config.load "foo.yml"
end
end
it "loads default config" do
config = Config.load
config.should_not be_nil