summaryrefslogtreecommitdiffstats
path: root/spec/unit/interface/action_spec.rb
diff options
context:
space:
mode:
authorMatt Robinson <matt@puppetlabs.com>2011-05-13 15:06:36 -0700
committerMatt Robinson <matt@puppetlabs.com>2011-05-13 15:06:36 -0700
commitc8215c550cbe7e3ad059637202b02267d401946d (patch)
treea05a61d4ca514ef466bccc8217a6d61b5cd4ca4c /spec/unit/interface/action_spec.rb
parent82fb02ce27c95d8326335a8d52a9ab7e676fe8d3 (diff)
parenta8e4df735abcbb61915c28378f2fd045bdcdeb42 (diff)
downloadpuppet-c8215c550cbe7e3ad059637202b02267d401946d.tar.gz
puppet-c8215c550cbe7e3ad059637202b02267d401946d.tar.xz
puppet-c8215c550cbe7e3ad059637202b02267d401946d.zip
Merge branch 'next'
* next: Revert "(#7220) Add the ability to "inherit" options." (#7469) Add license to test face so tests pass (#7264) Docs: Clarify that subscribe/notify imply require/before (#7468) Stub spec that tries to connect to pypi.python.org Prevent spec failure caused by network device mock leak Fix #7299 - do not require net/ssh for running rake spec
Diffstat (limited to 'spec/unit/interface/action_spec.rb')
-rwxr-xr-xspec/unit/interface/action_spec.rb59
1 files changed, 0 insertions, 59 deletions
diff --git a/spec/unit/interface/action_spec.rb b/spec/unit/interface/action_spec.rb
index f43968709..9e539c68e 100755
--- a/spec/unit/interface/action_spec.rb
+++ b/spec/unit/interface/action_spec.rb
@@ -68,65 +68,6 @@ describe Puppet::Interface::Action do
end
end
- describe "#inherit_options_from" do
- let :face do
- Puppet::Interface.new(:face_with_some_options, '0.0.1') do
- option '-w'
-
- action(:foo) do
- when_invoked do true end
- option '-x', '--ex'
- option '-y', '--why'
- end
-
- action(:bar) do
- when_invoked do true end
- option '-z', '--zee'
- end
-
- action(:baz) do
- when_invoked do true end
- option '-z', '--zed'
- end
-
- action(:noopts) do
- # no options declared
- when_invoked do true end
- end
- end
- end
-
- subject { action = face.action(:new_action) { when_invoked do true end } }
-
- it 'should add the options from the specified action' do
- subject.inherit_options_from(foo = face.get_action(:foo))
- subject.options.should == foo.options
- end
-
- it 'should not die when the specified action has no options' do
- original_options = subject.options
- subject.inherit_options_from(face.get_action(:noopts))
- subject.options.should == original_options
- end
-
- it 'should add the options from multiple actions' do
- subject.inherit_options_from(foo = face.get_action(:foo))
- subject.inherit_options_from(bar = face.get_action(:bar))
- subject.options.should == (foo.options + bar.options).uniq
- end
-
- it 'should not inherit face options' do
- subject.expects(:add_option)
- subject.expects(:add_option).with(face.get_option(:w)).never
- subject.inherit_options_from(face.get_action(:bar))
- end
-
- it 'should raise an error if inheritance would duplicate options' do
- subject.inherit_options_from(face.get_action(:bar))
- expect { subject.inherit_options_from(face.get_action(:baz)) }.to raise_error
- end
- end
-
describe "when invoking" do
it "should be able to call other actions on the same object" do
face = Puppet::Interface.new(:my_face, '0.0.1') do