spec/configurator_spec.rb in rconf-0.9.25 vs spec/configurator_spec.rb in rconf-0.10.0

- old
+ new

@@ -14,12 +14,12 @@ describe RightConf::Configurator do class TestConfigurator include RightConf::Configurator register :test - validate_has_settings :required - attr_reader :custom_setting + attr_accessor :custom_setting + setting 'required', 'required setting', :required => true def test_setter(value) @custom_setting = value end def check_darwin; true; end alias :check_linux :check_darwin @@ -32,11 +32,23 @@ class AnotherConfigurator include RightConf::Configurator register :another end + before(:all) do + # Disable overrides + RightConf::OverridesLanguage.instance_variable_set(:@overrides, {}) + end + before(:each) do @configurator = TestConfigurator.new(1) + end + + after(:all) do + confs = RightConf::ConfiguratorRegistry.instance.instance_variable_get(:@configurators) + confs.delete(:test) + confs.delete(:another) + RightConf::OverridesLanguage.instance_variable_set(:@overrides, nil) end it 'should register configurators' do RightConf::ConfiguratorRegistry[:test].should == TestConfigurator RightConf::ConfiguratorRegistry[:another].should == AnotherConfigurator