diff options
| author | James Turnbull <james@lovedthanlost.net> | 2008-10-21 09:50:54 +1100 |
|---|---|---|
| committer | James Turnbull <james@lovedthanlost.net> | 2008-10-21 09:50:54 +1100 |
| commit | 8a4e2e9378fe617b0d6b7210ed63f6d5e5bd9956 (patch) | |
| tree | 158f9ed9a596661b94efa8539186ac9054e8e961 /spec | |
| parent | e6f99f92ec5bfba973a3f13c629a8ce263a0da7d (diff) | |
| download | puppet-8a4e2e9378fe617b0d6b7210ed63f6d5e5bd9956.tar.gz puppet-8a4e2e9378fe617b0d6b7210ed63f6d5e5bd9956.tar.xz puppet-8a4e2e9378fe617b0d6b7210ed63f6d5e5bd9956.zip | |
Fixed #1663 - Regression relating to facter fact naming from 0.24.5
Diffstat (limited to 'spec')
| -rwxr-xr-x | spec/unit/parser/templatewrapper.rb | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/spec/unit/parser/templatewrapper.rb b/spec/unit/parser/templatewrapper.rb index 20ea76921..a8c464771 100755 --- a/spec/unit/parser/templatewrapper.rb +++ b/spec/unit/parser/templatewrapper.rb @@ -78,5 +78,18 @@ describe Puppet::Parser::TemplateWrapper do @tw.result @tw.instance_variable_get("@one").should == "foo" - end + end + + %w{! . ; :}.each do |badchar| + it "should translate #{badchar} to _ when setting the instance variables" 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("one#{badchar}" => "foo") + @tw.result + + @tw.instance_variable_get("@one_").should == "foo" + end + end end |
