diff options
| author | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2006-12-15 21:01:59 +0000 |
|---|---|---|
| committer | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2006-12-15 21:01:59 +0000 |
| commit | 9ad62d24093563e947d846fa3771bcebf550b8ee (patch) | |
| tree | b1be208226eab13b7c06a013911da506fb96a4dc | |
| parent | 0dac4ec6be5d89bb17ca474516e9b900d361f1b4 (diff) | |
| download | puppet-9ad62d24093563e947d846fa3771bcebf550b8ee.tar.gz puppet-9ad62d24093563e947d846fa3771bcebf550b8ee.tar.xz puppet-9ad62d24093563e947d846fa3771bcebf550b8ee.zip | |
Modifying rails test
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1939 980ebf18-57e1-0310-9a29-db15c13687c0
| -rwxr-xr-x | test/rails/rails.rb | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/test/rails/rails.rb b/test/rails/rails.rb index 05fad4c87..7ffeaccac 100755 --- a/test/rails/rails.rb +++ b/test/rails/rails.rb @@ -40,9 +40,16 @@ class TestRails < Test::Unit::TestCase @interp, @scope, @source = mkclassframing # First make some objects resources = [] - 20.times { |i| - resources << mkresource(:type => "file", :title => "/tmp/file#{i.to_s}", + 10.times { |i| + # Make a file + resources << mkresource(:type => "file", + :title => "/tmp/file#{i.to_s}", :params => {:owner => "user#{i}"}) + + # And an exec, so we're checking multiple types + resources << mkresource(:type => "exec", + :title => "/bin/echo file#{i.to_s}", + :params => {}) } # Now collect our facts @@ -74,6 +81,7 @@ class TestRails < Test::Unit::TestCase count = 0 host.resources.each do |resource| + assert_equal(host, resource.host) count += 1 i = nil if resource[:title] =~ /file([0-9]+)/ @@ -81,7 +89,10 @@ class TestRails < Test::Unit::TestCase else raise "Got weird resource %s" % resource.inspect end - assert_equal("user#{i}", resource.parameters["owner"]) + assert(resource[:type] != "", "Did not get a type from the resource") + if resource[:type] != "PuppetExec" + assert_equal("user#{i}", resource.parameters["owner"]) + end end assert_equal(20, count, "Did not get enough resources") |
