summaryrefslogtreecommitdiffstats
path: root/spec/unit/parser
diff options
context:
space:
mode:
authorLuke Kanies <luke@madstop.com>2007-11-26 15:26:05 -0600
committerLuke Kanies <luke@madstop.com>2007-11-26 15:26:05 -0600
commitfc7f1b4f70d8e4b62852a0da0af21fcb67a1a89c (patch)
tree6f6278277bd5b3c641a0f017a2fc423bcb161172 /spec/unit/parser
parent9311bdde6283a00e0f32b41e8171fc75c976ed97 (diff)
downloadpuppet-fc7f1b4f70d8e4b62852a0da0af21fcb67a1a89c.tar.gz
puppet-fc7f1b4f70d8e4b62852a0da0af21fcb67a1a89c.tar.xz
puppet-fc7f1b4f70d8e4b62852a0da0af21fcb67a1a89c.zip
Fixing #921, mostly by just deleting the existing test. I had
already migrated all of the tests into rspec but forgot about these tests -- they were only in the rails/ subdir because people kept not running the parser/ tests after modifying the Rails code.
Diffstat (limited to 'spec/unit/parser')
-rwxr-xr-xspec/unit/parser/collector.rb26
1 files changed, 22 insertions, 4 deletions
diff --git a/spec/unit/parser/collector.rb b/spec/unit/parser/collector.rb
index caeb2b5a3..72c4c627c 100755
--- a/spec/unit/parser/collector.rb
+++ b/spec/unit/parser/collector.rb
@@ -228,8 +228,10 @@ describe Puppet::Parser::Collector, "when collecting exported resources" do
one = stub 'one', :type => :mytype, :virtual? => true, :exported? => true
two = stub 'two', :type => :mytype, :virtual? => true, :exported? => true
- one.expects(:exported=).with(false)
- two.expects(:exported=).with(false)
+ one.stubs(:exported=)
+ one.stubs(:virtual=)
+ two.stubs(:exported=)
+ two.stubs(:virtual=)
@compile.expects(:resources).returns([one, two])
@@ -242,6 +244,20 @@ describe Puppet::Parser::Collector, "when collecting exported resources" do
one = stub 'one', :type => :mytype, :virtual? => true, :exported? => true
one.expects(:exported=).with(false)
+ one.stubs(:virtual=)
+
+ @compile.expects(:resources).returns([one])
+
+ @collector.evaluate.should == [one]
+ end
+
+ it "should mark all returned resources as not virtual" do
+ stub_rails(true)
+
+ one = stub 'one', :type => :mytype, :virtual? => true, :exported? => true
+
+ one.stubs(:exported=)
+ one.expects(:virtual=).with(false)
@compile.expects(:resources).returns([one])
@@ -257,7 +273,8 @@ describe Puppet::Parser::Collector, "when collecting exported resources" do
resource = mock 'resource'
one.expects(:to_resource).with(@scope).returns(resource)
- resource.expects(:exported=).with(false)
+ resource.stubs(:exported=)
+ resource.stubs(:virtual=)
@compile.stubs(:resources).returns([])
@scope.stubs(:findresource).returns(nil)
@@ -276,7 +293,8 @@ describe Puppet::Parser::Collector, "when collecting exported resources" do
resource = mock 'resource'
one.expects(:to_resource).with(@scope).returns(resource)
- resource.expects(:exported=).with(false)
+ resource.stubs(:exported=)
+ resource.stubs(:virtual=)
@compile.stubs(:resources).returns([])
@scope.stubs(:findresource).returns(nil)