summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2006-06-29 16:05:52 +0000
committerluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2006-06-29 16:05:52 +0000
commit56a28456c240bc25b89a4a6b02e39aaaef162391 (patch)
treec55f0f045f69ccd5ccd2cce74b330419636c6584 /test
parentd2754895ead8e8b036e29a628e3de9fad1abba34 (diff)
Adding report collection to both statechange and transaction.
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1336 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'test')
-rw-r--r--test/other/transactions.rb29
1 files changed, 29 insertions, 0 deletions
diff --git a/test/other/transactions.rb b/test/other/transactions.rb
index 65e159f1b..cfb00eaeb 100644
--- a/test/other/transactions.rb
+++ b/test/other/transactions.rb
@@ -17,6 +17,35 @@ class TestTransactions < Test::Unit::TestCase
def test_nothing
end
+ def test_reports
+ path1 = tempfile()
+ path2 = tempfile()
+ objects = []
+ objects << Puppet::Type.newfile(
+ :path => path1,
+ :content => "yayness"
+ )
+ objects << Puppet::Type.newfile(
+ :path => path2,
+ :content => "booness"
+ )
+
+ trans = assert_events([:file_created, :file_created], *objects)
+
+ report = nil
+
+ assert_nothing_raised {
+ report = trans.report
+ }
+
+ assert_equal(2, report.length,
+ "Did not get the right number of log messages back")
+
+ report.each do |obj|
+ assert_instance_of(Puppet::Log, obj)
+ end
+ end
+
unless %x{groups}.chomp.split(/ /).length > 1
$stderr.puts "You must be a member of more than one group to test transactions"
else