From 75ef3af26fcd205f316358b2f23abe5e200f6eaf Mon Sep 17 00:00:00 2001 From: Daniel Pittman Date: Mon, 4 Apr 2011 13:52:59 -0700 Subject: maint: added testing to ensure we inherit options correctly. --- spec/unit/string/action_spec.rb | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) 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 -- cgit