summaryrefslogtreecommitdiffstats
path: root/spec
diff options
context:
space:
mode:
authorSean E. Millichamp <sean@bruenor.org>2008-10-22 11:04:45 -0400
committerJames Turnbull <james@lovedthanlost.net>2008-10-23 10:13:34 +1100
commitf21623735deaeb5cd4207a24983ab985f0f9e6af (patch)
tree82ca8bbe2adf8b2b4c3303298b9337ce6b49ef9d /spec
parent81c3b721f7c2622d6145338dd28aa328fcf5af1a (diff)
downloadpuppet-f21623735deaeb5cd4207a24983ab985f0f9e6af.tar.gz
puppet-f21623735deaeb5cd4207a24983ab985f0f9e6af.tar.xz
puppet-f21623735deaeb5cd4207a24983ab985f0f9e6af.zip
Fixes #1663 - added Symbol check and additional test
Diffstat (limited to 'spec')
-rwxr-xr-xspec/unit/parser/templatewrapper.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/spec/unit/parser/templatewrapper.rb b/spec/unit/parser/templatewrapper.rb
index 6dbfbe266..532776223 100755
--- a/spec/unit/parser/templatewrapper.rb
+++ b/spec/unit/parser/templatewrapper.rb
@@ -86,6 +86,15 @@ describe Puppet::Parser::TemplateWrapper do
@tw.instance_variable_get("@one").should == "foo"
end
+ it "should not error out if one of the variables is a symbol" do
+ template_mock = mock("template", :result => "woot!")
+ File.expects(:read).with("/tmp/fake_template").returns("template contents")
+ ERB.expects(:new).with("template contents", 0, "-").returns(template_mock)
+
+ @scope.expects(:to_hash).returns(:_timestamp => "1234")
+ @tw.result
+ end
+
%w{! . ; :}.each do |badchar|
it "should translate #{badchar} to _ when setting the instance variables" do
template_mock = mock("template", :result => "woot!")