diff options
author | Christopher Brown <cb@opscode.com> | 2009-08-26 12:53:57 -0700 |
---|---|---|
committer | Christopher Brown <cb@opscode.com> | 2009-08-26 12:53:57 -0700 |
commit | 4804a909ab7b7d1a8f290869ed09ccf5f330f2bf (patch) | |
tree | 1f0cd0ecdf010393c9d7667f8f4e06dff6a37d81 /features/steps/config_steps.rb | |
parent | fa4bdd1a6b39c7dc4be804d6c871d28a552afbcc (diff) | |
parent | 89b9dac377a441acd9c41b15482320ffcb03779e (diff) | |
download | mixlib-config-class_instance_variable.tar.gz |
integrate nuo's class instance variable with attribute setter changesclass_instance_variable
Diffstat (limited to 'features/steps/config_steps.rb')
-rw-r--r-- | features/steps/config_steps.rb | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/features/steps/config_steps.rb b/features/steps/config_steps.rb index 867702d..0785af3 100644 --- a/features/steps/config_steps.rb +++ b/features/steps/config_steps.rb @@ -16,17 +16,35 @@ # limitations under the License. # -Given /^a configuration class$/ do +Given /^a configuration class '(.+)'$/ do |classname| end -When /^I set '(.+)' to '(.+)'$/ do |key, value| - ConfigIt[key.to_sym] = value +When /^I set '(.+)' to '(.+)' in configuration class '(.+)'$/ do |key, value, classname| + + #ConfigIt[key.to_sym] = value + if classname == 'ConfigIt' + ConfigIt[key.to_sym] = value + elsif classname == 'ConfigItToo' + ConfigItToo[key.to_sym] = value + else + raise ArgumentError, "configuration class must be ConfigIt or ConfigItToo" + end end Then /^config option '(.+)' is '(.+)'$/ do |key, value| ConfigIt[key.to_sym].should == value end +Then /^in configuration class '(.+)' config option '(.+)' is '(.+)'$/ do |classname, key, value| + if classname == 'ConfigIt' + ConfigIt[key.to_sym].should == value + elsif classname == 'ConfigItToo' + ConfigItToo[key.to_sym].should == value + else + raise ArgumentError, "configuration class must be ConfigIt or ConfigItToo" + end +end + When /^I set '(.+)' to:$/ do |key, foo_table| ConfigIt[key.to_sym] = Array.new foo_table.hashes.each do |hash| |