spec/figleaf/settings_spec.rb in figleaf-0.2.9 vs spec/figleaf/settings_spec.rb in figleaf-0.3.0
- old
+ new
@@ -1,6 +1,6 @@
-require 'spec_helper'
+require "spec_helper"
describe Figleaf::Settings do
describe "self.load_settings" do
before do
@fixtures_path = File.expand_path("../../fixtures/*.yml", __FILE__)
@@ -45,36 +45,36 @@
described_class.load_settings(@fixtures_path, "alt")
expect(described_class.boolean).to eq(false)
end
it "and for erb values" do
- expect(described_class.erb.foo).to eq('foo')
+ expect(described_class.erb.foo).to eq("foo")
expect(described_class.erb.bar).to be_nil
end
it "raise exception when loading an undefined value" do
- YAML.stub(:load_yaml_file).and_return({ "test" => {} })
+ YAML.stub(:load_yaml_file).and_return({"test" => {}})
described_class.load_settings
expect { described_class.service.blah }.to raise_error NoMethodError
end
context "with bad files" do
context "yaml" 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)
+ expect { described_class.load_settings(overload, "test") }
+ .to raise_error(described_class::InvalidYAML)
end
end
context "rb" do
let(:overload) { File.expand_path("../../fixtures/errors/*.rb", __FILE__) }
it "reports the file that has errors" do
- expect { described_class.load_settings(overload, "test") }.
- to raise_error(described_class::InvalidRb)
+ expect { described_class.load_settings(overload, "test") }
+ .to raise_error(described_class::InvalidRb)
end
end
end
context "overloading settings" do
@@ -82,12 +82,12 @@
overload = File.expand_path("../../fixtures/extra/*.yml", __FILE__)
described_class.load_settings(overload, "test")
end
it "merge values for matching env" do
- expect(described_class.service.foo).to eq 'overridden'
- expect(described_class.service.extra).to eq 'extra'
+ expect(described_class.service.foo).to eq "overridden"
+ expect(described_class.service.extra).to eq "extra"
expect(described_class.service.bool_false).to eq(false)
expect(described_class.service.bool_true).to eq(true)
end
it "not change existing settings for missing env" do
@@ -165,9 +165,9 @@
it "and for boolean (false)" do
expect(described_class.code.bool_false).to eq(false)
end
it "and for ENV values" do
- expect(described_class.code.from_env).to eq('foo')
+ expect(described_class.code.from_env).to eq("foo")
end
end
end