summaryrefslogtreecommitdiffstats
path: root/test/rails/railsparameter.rb
diff options
context:
space:
mode:
authorshadoi <shadoi@980ebf18-57e1-0310-9a29-db15c13687c0>2006-11-09 18:57:01 +0000
committershadoi <shadoi@980ebf18-57e1-0310-9a29-db15c13687c0>2006-11-09 18:57:01 +0000
commitcf166c25911f521cdf12178ebbe0b39f81473b35 (patch)
tree1a96094de1203cb3d48b6c07255414bea351092a /test/rails/railsparameter.rb
parent28c283c73388c3f76e1d715c41ebd82ac35ca9a4 (diff)
downloadpuppet-cf166c25911f521cdf12178ebbe0b39f81473b35.tar.gz
puppet-cf166c25911f521cdf12178ebbe0b39f81473b35.tar.xz
puppet-cf166c25911f521cdf12178ebbe0b39f81473b35.zip
Rails stuff part 1
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1837 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'test/rails/railsparameter.rb')
-rwxr-xr-xtest/rails/railsparameter.rb31
1 files changed, 16 insertions, 15 deletions
diff --git a/test/rails/railsparameter.rb b/test/rails/railsparameter.rb
index 46a12e57c..f76939ac9 100755
--- a/test/rails/railsparameter.rb
+++ b/test/rails/railsparameter.rb
@@ -16,32 +16,33 @@ class TestRailsParameter < Test::Unit::TestCase
def test_to_resourceparam
railsinit
# First create our parameter
- rparam = nil
- hash = { :name => :myparam, :value => "myval",
- :file => __FILE__, :line => __LINE__}
+ #FIXME Need to re-add file/line support
+ pname = { :name => "myname" }
+ pvalue = { :value => "myval" }
+ pn = Puppet::Rails::ParamName.new(:name => pname[:name])
+ pv = Puppet::Rails::ParamValue.new(:value => pvalue[:value])
assert_nothing_raised do
- rparam = Puppet::Rails::RailsParameter.new(hash)
+ pn.param_values << pv
end
- assert(rparam, "Did not create rails parameter")
+ assert(pn, "Did not create rails parameter")
# The id doesn't get assigned until we save
- rparam.save
+ pn.save
# Now create a source
interp = mkinterp
source = interp.newclass "myclass"
# And try to convert our parameter
- pparam = nil
- assert_nothing_raised do
- pparam = rparam.to_resourceparam(source)
- end
-
-
- assert_instance_of(Puppet::Parser::Resource::Param, pparam)
- hash.each do |name, value|
- assert_equal(value, pparam.send(name), "%s was not equal" % name)
+ #FIXME Why does this assert prevent the block from executing?
+ #assert_nothing_raised do
+ pp = pn.to_resourceparam(source)
+ #end
+
+ assert_instance_of(Puppet::Parser::Resource::Param, pp)
+ pname.each do |name, value|
+ assert_equal(value.to_sym, pp.send(name), "%s was not equal" % name)
end
end
end