diff options
| author | Luke Kanies <luke@puppetlabs.com> | 2011-07-15 11:54:33 -0700 |
|---|---|---|
| committer | Luke Kanies <luke@puppetlabs.com> | 2011-07-15 11:54:33 -0700 |
| commit | d69bf48ecae71ff01679bb38cdeebc8f4a8b8b15 (patch) | |
| tree | 6f6b25251f0a581c878b833a90e5b3bab0ac5d11 /spec/unit/parser/templatewrapper_spec.rb | |
| parent | 4ad404ee7e7244d94ff4d87effc1a041d65b3f73 (diff) | |
| parent | bdc0f8716ae8ccb2b2657dfab591afe9589d8902 (diff) | |
Merge branch 'refactor/master/8232-array_indexers_on_scope'
Diffstat (limited to 'spec/unit/parser/templatewrapper_spec.rb')
| -rwxr-xr-x | spec/unit/parser/templatewrapper_spec.rb | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/spec/unit/parser/templatewrapper_spec.rb b/spec/unit/parser/templatewrapper_spec.rb index 600293bbf..6080346fb 100755 --- a/spec/unit/parser/templatewrapper_spec.rb +++ b/spec/unit/parser/templatewrapper_spec.rb @@ -72,25 +72,23 @@ describe Puppet::Parser::TemplateWrapper do end it "should return the contents of a variable if called via method_missing" do - @scope.expects(:lookupvar).with { |name,options| name == "chicken"}.returns("is good") + @scope["chicken"] = "is good" tw = Puppet::Parser::TemplateWrapper.new(@scope) tw.chicken.should eql("is good") end it "should throw an exception if a variable is called via method_missing and it does not exist" do - @scope.expects(:lookupvar).with { |name,options| name == "chicken"}.returns(:undefined) tw = Puppet::Parser::TemplateWrapper.new(@scope) lambda { tw.chicken }.should raise_error(Puppet::ParseError) end it "should allow you to check whether a variable is defined with has_variable?" do - @scope.expects(:lookupvar).with { |name,options| name == "chicken"}.returns("is good") + @scope["chicken"] = "is good" tw = Puppet::Parser::TemplateWrapper.new(@scope) tw.has_variable?("chicken").should eql(true) end it "should allow you to check whether a variable is not defined with has_variable?" do - @scope.expects(:lookupvar).with { |name,options| name == "chicken"}.returns(:undefined) tw = Puppet::Parser::TemplateWrapper.new(@scope) tw.has_variable?("chicken").should eql(false) end |
