summaryrefslogtreecommitdiffstats
path: root/spec/unit/property.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/unit/property.rb')
-rwxr-xr-xspec/unit/property.rb24
1 files changed, 11 insertions, 13 deletions
diff --git a/spec/unit/property.rb b/spec/unit/property.rb
index 6d3871d7b..5bc29a61a 100755
--- a/spec/unit/property.rb
+++ b/spec/unit/property.rb
@@ -108,21 +108,26 @@ describe Puppet::Property do
describe "when creating an event" do
before do
- @resource = stub 'resource', :ref => "File[/foo]", :file => "/my/file", :line => 50, :tags => %w{foo bar}, :version => 42
+ @event = Puppet::Transaction::Event.new
+
+ # Use a real resource so we can test the event creation integration
+ @resource = Puppet::Type.type(:mount).new :name => "foo"
@instance = @class.new(:resource => @resource)
@instance.stubs(:should).returns "myval"
end
+ it "should use an event from the resource as the base event" do
+ event = Puppet::Transaction::Event.new
+ @resource.expects(:event).returns event
+
+ @instance.event.should equal(event)
+ end
+
it "should have the default event name" do
@instance.expects(:event_name).returns :my_event
@instance.event.name.should == :my_event
end
- it "should have the resource's reference as the resource" do
- @resource.stubs(:ref).returns "File[/yay]"
- @instance.event.resource.should == "File[/yay]"
- end
-
it "should have the property's name" do
@instance.event.property.should == @instance.name
end
@@ -131,13 +136,6 @@ describe Puppet::Property do
@instance.stubs(:should).returns "foo"
@instance.event.desired_value.should == "foo"
end
-
- {:file => "/my/file", :line => 50, :tags => %{foo bar}, :version => 50}.each do |attr, value|
- it "should set the #{attr}" do
- @instance.stubs(attr).returns value
- @instance.event.send(attr).should == value
- end
- end
end
describe "when shadowing metaparameters" do