diff options
author | shadoi <shadoi@980ebf18-57e1-0310-9a29-db15c13687c0> | 2007-02-17 01:52:59 +0000 |
---|---|---|
committer | shadoi <shadoi@980ebf18-57e1-0310-9a29-db15c13687c0> | 2007-02-17 01:52:59 +0000 |
commit | 8b18fdfe1ad86fd28732e3bbe243459a4f00c74c (patch) | |
tree | 8f3c5bd5349aa7caecc7ba004379cab69b558012 | |
parent | 9fe8905abf99c7683d4ac0ce111f567d83f22b54 (diff) | |
download | puppet-8b18fdfe1ad86fd28732e3bbe243459a4f00c74c.tar.gz puppet-8b18fdfe1ad86fd28732e3bbe243459a4f00c74c.tar.xz puppet-8b18fdfe1ad86fd28732e3bbe243459a4f00c74c.zip |
Undo the params & facts stuff
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2206 980ebf18-57e1-0310-9a29-db15c13687c0
-rwxr-xr-x | test/rails/railsparameter.rb | 8 | ||||
-rwxr-xr-x | test/rails/railsresource.rb | 7 |
2 files changed, 11 insertions, 4 deletions
diff --git a/test/rails/railsparameter.rb b/test/rails/railsparameter.rb index 2a306890b..337f4cb3c 100755 --- a/test/rails/railsparameter.rb +++ b/test/rails/railsparameter.rb @@ -25,12 +25,18 @@ class TestRailsParameter < Test::Unit::TestCase # Use array and non-array values, to make sure we get things back in # the same form. {"myname" => "myval", "multiple" => %w{one two three}}.each do |name, value| - param = Puppet::Rails::ParamName.new(:name => name, :value => value) + param = Puppet::Rails::ParamName.new(:name => name) if value.is_a? Array values = value else values = [value] end + valueobjects = values.collect do |v| + obj = Puppet::Rails::ParamValue.new(:value => v) + assert_nothing_raised do + param.param_values << obj + end + end assert(param, "Did not create rails parameter") diff --git a/test/rails/railsresource.rb b/test/rails/railsresource.rb index f3cdc22a6..302dd99fb 100755 --- a/test/rails/railsresource.rb +++ b/test/rails/railsresource.rb @@ -36,8 +36,9 @@ class TestRailsResource < Test::Unit::TestCase # Now add some params params.each do |param, value| - pn = resource.params.find_or_create_by_name_and_value(param, value) - resource.params << pn + pn = resource.param_names.find_or_create_by_name(param) + pv = pn.param_values.find_or_create_by_value(value) + resource.param_names << pn end host.save @@ -57,7 +58,7 @@ class TestRailsResource < Test::Unit::TestCase interp, scope, source = mkclassframing # Find the new resource and include all it's parameters. - resource = Puppet::Rails::Resource.find_by_id(resource.id, :include => [ :params ]) + resource = Puppet::Rails::Resource.find_by_id(resource.id, :include => [ :param_names, :param_values ]) # Now, try to convert our resource to a real resource res = nil |