diff options
| author | Luke Kanies <luke@madstop.com> | 2007-11-28 15:20:52 -0600 |
|---|---|---|
| committer | Luke Kanies <luke@madstop.com> | 2007-11-28 15:20:52 -0600 |
| commit | 11ae473e3852adcc382a3efea2329586d2e4bcb3 (patch) | |
| tree | 7a7ff70f7d9f7bc9af0635c56690fb9fc810b9f5 /test/rails | |
| parent | 8127397e1efafc13975b79eabf7ce951c1e90114 (diff) | |
| download | puppet-11ae473e3852adcc382a3efea2329586d2e4bcb3.tar.gz puppet-11ae473e3852adcc382a3efea2329586d2e4bcb3.tar.xz puppet-11ae473e3852adcc382a3efea2329586d2e4bcb3.zip | |
Theoretically, this patch is to fix #917 (which it does), but
there were enough problems fixing it that I decided something
more drastic needed to be done.
This uses the new Puppet::ResourceReference class to canonize
what a resource reference looks like and how to retrieve resources
via their references. Specifically, it guarantees that resource types
are always capitalized, even when they include '::' in them.
While many files are modified in this commit, the majority of changes are
quite small, and most of the changes are fixing the tests to use
capitalized types.
As we look at consolidating some of our resource types, we could consolidate
the ResourceReference stuff at the same time, but at least the
Puppet::Parser::ResourceReference class subclasses the main Puppet::ResourceReference
class.
Diffstat (limited to 'test/rails')
| -rwxr-xr-x | test/rails/ast.rb | 2 | ||||
| -rwxr-xr-x | test/rails/configuration.rb | 2 | ||||
| -rwxr-xr-x | test/rails/host.rb | 4 |
3 files changed, 4 insertions, 4 deletions
diff --git a/test/rails/ast.rb b/test/rails/ast.rb index ac086fde1..e51fa6cf7 100755 --- a/test/rails/ast.rb +++ b/test/rails/ast.rb @@ -62,7 +62,7 @@ class TestRailsAST < PuppetTest::TestCase assert_equal(1, retval.length, "Did not find resource with '#{string}'") res = retval.shift - assert_equal("file", res.restype) + assert_equal("File", res.restype) assert_equal("/tmp/testing", res.title) else assert_equal(0, retval.length, "found a resource with '#{string}'") diff --git a/test/rails/configuration.rb b/test/rails/configuration.rb index ea66bc902..9e2ddfedd 100755 --- a/test/rails/configuration.rb +++ b/test/rails/configuration.rb @@ -36,7 +36,7 @@ class ConfigurationRailsTests < PuppetTest::TestCase Puppet[:storeconfigs] = true Puppet::Rails::Host.expects(:store).with do |node, resources| - if res = resources.find { |r| r.type == "file" and r.title == "/tmp/yay" } + if res = resources.find { |r| r.type == "File" and r.title == "/tmp/yay" } assert_equal("root", res["owner"], "Did not set default on resource") true else diff --git a/test/rails/host.rb b/test/rails/host.rb index dd1bb2a42..5853e8219 100755 --- a/test/rails/host.rb +++ b/test/rails/host.rb @@ -89,10 +89,10 @@ class TestRailsHost < PuppetTest::TestCase end assert(resource[:restype] != "", "Did not get a type from the resource") case resource["restype"] - when "file": + when "File": assert_equal("user#{i}", resource.parameter("owner"), "got no owner for %s" % resource.ref) - when "exec": + when "Exec": assert_equal("user#{i}", resource.parameter("user"), "got no user for %s" % resource.ref) else |
