diff options
author | Jesse Wolfe <jes5199@gmail.com> | 2010-04-09 14:22:36 -0700 |
---|---|---|
committer | Jesse Wolfe <jes5199@gmail.com> | 2010-04-09 14:22:36 -0700 |
commit | 94651df232b0bc0fed066ac005cccc9d5db0c152 (patch) | |
tree | da13d3de3eb9e83c955d607efcb66eddf05721d9 /spec | |
parent | 40c1fb06162f2eebe6cd5e40a0e289cd568ec8e1 (diff) | |
download | puppet-94651df232b0bc0fed066ac005cccc9d5db0c152.tar.gz puppet-94651df232b0bc0fed066ac005cccc9d5db0c152.tar.xz puppet-94651df232b0bc0fed066ac005cccc9d5db0c152.zip |
Add stub to Puppet::Parser::Collector test to prevent runaway stub
failures
Diffstat (limited to 'spec')
-rwxr-xr-x | spec/unit/parser/collector.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/spec/unit/parser/collector.rb b/spec/unit/parser/collector.rb index 42da3ff9e..de5fc8015 100755 --- a/spec/unit/parser/collector.rb +++ b/spec/unit/parser/collector.rb @@ -272,6 +272,10 @@ describe Puppet::Parser::Collector, "when collecting exported resources" do @equery = "test = true" @vquery = proc { |r| true } + res = stub("resource 1") + res.stubs(:type).returns @resource_type + Puppet::Resource.stubs(:new).returns res + Puppet.settings.stubs(:value).with(:storeconfigs).returns true Puppet.settings.stubs(:value).with(:environment).returns "production" @@ -360,7 +364,7 @@ describe Puppet::Parser::Collector, "when collecting exported resources" do one = stub 'one', :restype => "Mytype", :title => "one", :virtual? => true, :exported? => true, :ref => "one" Puppet::Rails::Resource.stubs(:find).returns([one]) - resource = mock 'resource' + resource = mock 'resource', :type => "Mytype" one.expects(:to_resource).with(@scope).returns(resource) resource.stubs(:exported=) resource.stubs(:virtual=) |