summaryrefslogtreecommitdiffstats
path: root/spec/unit/parser/templatewrapper_spec.rb
diff options
context:
space:
mode:
authorDominic Maraglia <dominic@puppetlabs.com>2011-08-03 15:43:20 -0700
committerDominic Maraglia <dominic@puppetlabs.com>2011-08-03 15:43:20 -0700
commite45f08bf1fef8842554ca0d8cb6fb13711e888e7 (patch)
tree9bb476a0fe381d53060abc1f1c240cf1291b2ee4 /spec/unit/parser/templatewrapper_spec.rb
parenta97c86e7d01384aa06f5d4d69da427fc355aebe7 (diff)
parentc833fde370d43023f52c8f2e11fd77e720d0f577 (diff)
downloadpuppet-e45f08bf1fef8842554ca0d8cb6fb13711e888e7.tar.gz
puppet-e45f08bf1fef8842554ca0d8cb6fb13711e888e7.tar.xz
puppet-e45f08bf1fef8842554ca0d8cb6fb13711e888e7.zip
Merge branch 'master' of github.com:puppetlabs/puppet
Diffstat (limited to 'spec/unit/parser/templatewrapper_spec.rb')
-rwxr-xr-xspec/unit/parser/templatewrapper_spec.rb6
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