diff options
| author | Paul Berry <paul@puppetlabs.com> | 2010-12-30 11:01:23 -0800 |
|---|---|---|
| committer | Paul Berry <paul@puppetlabs.com> | 2010-12-30 11:56:23 -0800 |
| commit | 98db2da4e9b35f6260bf07c641550b380b603baa (patch) | |
| tree | bbabd4b8603d4e0b88fa28d3c48848a6dfc5c2a7 /spec | |
| parent | bd4a8a13a85e6d64c987765cb83b1ebd4a63a341 (diff) | |
(#5715) Removed unnecessary attributes from YAML of Puppet::Transaction::Event.
The removed attributes are file, line, resource, tags,
source_description, and default_log_level. These attributes were all
redundant with those in Puppet::Resource::Status.
Diffstat (limited to 'spec')
| -rwxr-xr-x | spec/unit/transaction/event_spec.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/spec/unit/transaction/event_spec.rb b/spec/unit/transaction/event_spec.rb index 2776be8d7..6ed14722b 100755 --- a/spec/unit/transaction/event_spec.rb +++ b/spec/unit/transaction/event_spec.rb @@ -111,4 +111,17 @@ describe Puppet::Transaction::Event do Puppet::Transaction::Event.new(:resource => "Foo[bar]").send_log end end + + describe "When converting to YAML" do + it "should include only documented attributes" do + resource = Puppet::Type.type(:file).new(:title => "/tmp/foo") + event = Puppet::Transaction::Event.new(:source_description => "/my/param", :resource => resource, + :file => "/foo.rb", :line => 27, :tags => %w{one two}, + :desired_value => 7, :historical_value => 'Brazil', + :message => "Help I'm trapped in a spec test", + :name => :mode_changed, :previous_value => 6, :property => :mode, + :status => 'success') + event.to_yaml_properties.should == Puppet::Transaction::Event::YAML_ATTRIBUTES.sort + end + end end |
