summaryrefslogtreecommitdiffstats
path: root/test/rails/rails.rb
diff options
context:
space:
mode:
authorluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2006-12-19 04:57:57 +0000
committerluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2006-12-19 04:57:57 +0000
commit9f4870637ce57d548d23c0b3330200014327c268 (patch)
treeb820cfb5a8150dc00d475ffe0cde6316ad210a91 /test/rails/rails.rb
parentdc5f4dc0d01dc2ccb4679afbf3802a7ab0f3c126 (diff)
downloadpuppet-9f4870637ce57d548d23c0b3330200014327c268.tar.gz
puppet-9f4870637ce57d548d23c0b3330200014327c268.tar.xz
puppet-9f4870637ce57d548d23c0b3330200014327c268.zip
All rails *and* language tests now pass, with the exception of a language/resource test that passes by itself but fails when run as part of the whole suite. Also, I added deletion where appropriate, so that unspecified resources, parameters, and facts are now deleted, as one would expect.
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1951 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'test/rails/rails.rb')
-rwxr-xr-xtest/rails/rails.rb84
1 files changed, 0 insertions, 84 deletions
diff --git a/test/rails/rails.rb b/test/rails/rails.rb
index 69e1fd7b8..c0f902d65 100755
--- a/test/rails/rails.rb
+++ b/test/rails/rails.rb
@@ -32,90 +32,6 @@ class TestRails < Test::Unit::TestCase
require 'puppet/rails'
}
end
-
- # Don't do any tests w/out this class
- if Puppet.features.rails?
- def test_hostcache
- @interp, @scope, @source = mkclassframing
- # First make some objects
- resources = []
- 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 => {:user => "user#{i}"})
- }
-
- # Now collect our facts
- facts = {"hostname" => Facter.value(:hostname), "test1" => "funtest"}
-
- # Now try storing our crap
- host = nil
- assert_nothing_raised {
- host = Puppet::Rails::Host.store(
- :resources => resources,
- :facts => facts,
- :name => facts["hostname"],
- :classes => ["one", "two::three", "four"]
- )
- }
-
- assert(host, "Did not create host")
-
- host = nil
- assert_nothing_raised {
- host = Puppet::Rails::Host.find_by_name(facts["hostname"])
- }
- assert(host, "Could not find host object")
-
- assert(host.resources, "No objects on host")
-
- assert_equal(facts["hostname"], host.facts("hostname"),
- "Did not retrieve facts")
-
- count = 0
- host.resources.each do |resource|
- assert_equal(host, resource.host)
- count += 1
- i = nil
- if resource[:title] =~ /file([0-9]+)/
- i = $1
- else
- raise "Got weird resource %s" % resource.inspect
- end
- assert(resource[:restype] != "", "Did not get a type from the resource")
- case resource["restype"]
- when "file":
- assert_equal("user#{i}", resource.parameter("owner"),
- "got no owner for %s" % resource.ref)
- when "exec":
- assert_equal("user#{i}", resource.parameter("user"),
- "got no user for %s" % resource.ref)
- else
- raise "Unknown type %s" % resource[:restype].inspect
- end
- end
-
- assert_equal(20, count, "Did not get enough resources")
-
- host = nil
- assert_nothing_raised {
- host = Puppet::Rails::Host.store(
- :resources => resources,
- :facts => facts,
- :name => facts["hostname"],
- :classes => ["one", "two::three", "four"]
- )
- }
- end
- else
- $stderr.puts "Install Rails for Rails and Caching tests"
- end
end
# $Id$