summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuke Kanies <luke@madstop.com>2009-08-01 23:28:55 -0700
committerJames Turnbull <james@lovedthanlost.net>2009-08-02 16:38:49 +1000
commitf7e1c36c6c0c03e1f969da7856828c92fdee2b61 (patch)
treeb5bcbe8e374bb78ff0aaa91971b082b9947e1646
parent54a225dd26d867d5672df48a5bc0ed858821bf40 (diff)
downloadpuppet-f7e1c36c6c0c03e1f969da7856828c92fdee2b61.tar.gz
puppet-f7e1c36c6c0c03e1f969da7856828c92fdee2b61.tar.xz
puppet-f7e1c36c6c0c03e1f969da7856828c92fdee2b61.zip
Fixing a test broken by the regex features
Unsetting scope vars was broken, but it was only ever used in testing (and apparently rarely at that), so it wasn't caught. Signed-off-by: Luke Kanies <luke@madstop.com>
-rwxr-xr-xspec/unit/parser/scope.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/spec/unit/parser/scope.rb b/spec/unit/parser/scope.rb
index 665b2ed63..0859eadb4 100755
--- a/spec/unit/parser/scope.rb
+++ b/spec/unit/parser/scope.rb
@@ -279,4 +279,18 @@ describe Puppet::Parser::Scope do
@scope.ephemeral_from(@match)
end
end
+
+ describe "when unsetting variables" do
+ it "should be able to unset normal variables" do
+ @scope.setvar("foo", "bar")
+ @scope.unsetvar("foo")
+ @scope.lookupvar("foo").should == ""
+ end
+
+ it "should be able to unset ephemeral variables" do
+ @scope.setvar("foo", "bar", :ephemeral => true)
+ @scope.unsetvar("foo")
+ @scope.lookupvar("foo").should == ""
+ end
+ end
end