diff options
author | Daniel Pittman <daniel@puppetlabs.com> | 2011-04-04 13:52:59 -0700 |
---|---|---|
committer | Daniel Pittman <daniel@puppetlabs.com> | 2011-04-04 13:52:59 -0700 |
commit | 75ef3af26fcd205f316358b2f23abe5e200f6eaf (patch) | |
tree | 2644bf5d2c246187e28e85e16a0261e34e5d18a7 /spec | |
parent | 9ce031d300738c778254358792ee295c08252cff (diff) | |
download | puppet-75ef3af26fcd205f316358b2f23abe5e200f6eaf.tar.gz puppet-75ef3af26fcd205f316358b2f23abe5e200f6eaf.tar.xz puppet-75ef3af26fcd205f316358b2f23abe5e200f6eaf.zip |
maint: added testing to ensure we inherit options correctly.
Diffstat (limited to 'spec')
-rwxr-xr-x | spec/unit/string/action_spec.rb | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/spec/unit/string/action_spec.rb b/spec/unit/string/action_spec.rb index e5fefdbdc..1d25ff156 100755 --- a/spec/unit/string/action_spec.rb +++ b/spec/unit/string/action_spec.rb @@ -121,6 +121,22 @@ describe Puppet::String::Action do string.get_action(:foo).options.should =~ [:bar, :quux] end + it "should fetch options that the string inherited" do + parent = Class.new(Puppet::String) + parent.option "--foo" + child = parent.new(:inherited_options, '0.0.1') do + option "--bar" + action :action do option "--baz" end + end + + action = child.get_action(:action) + action.should be + + [:baz, :bar, :foo].each do |name| + action.get_option(name).should be_an_instance_of Puppet::String::Option + end + end + it "should get an action option when asked" do string.get_action(:foo).get_option(:bar). should be_an_instance_of Puppet::String::Option |