spec/mixlib/config_spec.rb in mixlib-config-2.1.0 vs spec/mixlib/config_spec.rb in mixlib-config-2.2.0

- old
+ new

@@ -100,27 +100,27 @@ StrictClass.x = StrictClass.x * 2 StrictClass[:x] = StrictClass[:x] * 2 end it "raises an error when you get an arbitrary config option with .y" do - lambda { StrictClass.y }.should raise_error(Mixlib::Config::UnknownConfigOptionError) + lambda { StrictClass.y }.should raise_error(Mixlib::Config::UnknownConfigOptionError, "Reading unsupported config value y.") end it "raises an error when you get an arbitrary config option with [:y]" do - lambda { StrictClass[:y] }.should raise_error(Mixlib::Config::UnknownConfigOptionError) + lambda { StrictClass[:y] }.should raise_error(Mixlib::Config::UnknownConfigOptionError, "Reading unsupported config value y.") end it "raises an error when you set an arbitrary config option with .y = 10" do - lambda { StrictClass.y = 10 }.should raise_error(Mixlib::Config::UnknownConfigOptionError) + lambda { StrictClass.y = 10 }.should raise_error(Mixlib::Config::UnknownConfigOptionError, "Cannot set unsupported config value y.") end - it "raises an error when you get an arbitrary config option with .y 10" do - lambda { StrictClass.y 10 }.should raise_error(Mixlib::Config::UnknownConfigOptionError) + it "raises an error when you set an arbitrary config option with .y 10" do + lambda { StrictClass.y 10 }.should raise_error(Mixlib::Config::UnknownConfigOptionError, "Cannot set unsupported config value y.") end - it "raises an error when you get an arbitrary config option with [:y] = 10" do - lambda { StrictClass[:y] = 10 }.should raise_error(Mixlib::Config::UnknownConfigOptionError) + it "raises an error when you set an arbitrary config option with [:y] = 10" do + lambda { StrictClass[:y] = 10 }.should raise_error(Mixlib::Config::UnknownConfigOptionError, "Cannot set unsupported config value y.") end end describe "when a block has been used to set config values" do before do @@ -223,11 +223,11 @@ end Object.send :define_method, "daemonizeme=".to_sym do raise NopeError, "NOPE" end end - + it 'Normal classes call the extra method' do normal_class = Class.new normal_class.extend(::Mixlib::Config) lambda { normal_class.daemonizeme }.should raise_error(NopeError) end @@ -885,11 +885,11 @@ it "The parent class allows you to set arbitrary config options" do StrictClass2.y = 10 end it "The nested class does not allow you to set arbitrary config options" do - lambda { StrictClass2.c.y = 10 }.should raise_error(Mixlib::Config::UnknownConfigOptionError) + lambda { StrictClass2.c.y = 10 }.should raise_error(Mixlib::Config::UnknownConfigOptionError, "Cannot set unsupported config value y.") end end describe "When strict mode is on but a nested context has strict mode unspecified" do class StrictClass3 @@ -898,14 +898,14 @@ default :x, 1 config_context :c end it "The parent class does not allow you to set arbitrary config options" do - lambda { StrictClass3.y = 10 }.should raise_error(Mixlib::Config::UnknownConfigOptionError) + lambda { StrictClass3.y = 10 }.should raise_error(Mixlib::Config::UnknownConfigOptionError, "Cannot set unsupported config value y.") end it "The nested class does not allow you to set arbitrary config options" do - lambda { StrictClass3.y = 10 }.should raise_error(Mixlib::Config::UnknownConfigOptionError) + lambda { StrictClass3.y = 10 }.should raise_error(Mixlib::Config::UnknownConfigOptionError, "Cannot set unsupported config value y.") end end describe "When a config_context is opened twice" do before :each do