spec/figleaf/settings_spec.rb in figleaf-0.2.1 vs spec/figleaf/settings_spec.rb in figleaf-0.2.2
- old
+ new
@@ -77,9 +77,18 @@
YAML.stub(:load_file).and_return({ "test" => {} })
described_class.load_settings
expect { described_class.service.blah }.to raise_error NoMethodError
end
+ context "with bad files" do
+ let(:overload) { File.expand_path("../../fixtures/errors/*.yml", __FILE__) }
+
+ it "reports the file that has errors" do
+ expect { described_class.load_settings(overload, "test") }.
+ to raise_error(described_class::InvalidYAML)
+ end
+ end
+
context "overloading settings" do
before do
overload = File.expand_path("../../fixtures/extra/*.yml", __FILE__)
described_class.load_settings(overload, "test")
end