diff options
| author | Luke Kanies <luke@puppetlabs.com> | 2011-06-16 18:37:04 -0700 |
|---|---|---|
| committer | Luke Kanies <luke@puppetlabs.com> | 2011-07-15 11:52:12 -0700 |
| commit | b3c155430965280ab59b1dd70c020c6da3396fc9 (patch) | |
| tree | 2e6300bb4dd5394a996aecfb83cd3ce97761672a /spec/unit | |
| parent | 9d608ea176224f38c6af349883065d9363dd1bb1 (diff) | |
| download | puppet-b3c155430965280ab59b1dd70c020c6da3396fc9.tar.gz puppet-b3c155430965280ab59b1dd70c020c6da3396fc9.tar.xz puppet-b3c155430965280ab59b1dd70c020c6da3396fc9.zip | |
Adding Scope#include? method
This is primarily for Hiera/DataLibrary support,
but is a decent idea regardless.
Signed-off-by: Luke Kanies <luke@puppetlabs.com>
Reviewed-by: Nick Lewis <nick@puppetlabs.com>
Diffstat (limited to 'spec/unit')
| -rwxr-xr-x | spec/unit/parser/scope_spec.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/spec/unit/parser/scope_spec.rb b/spec/unit/parser/scope_spec.rb index e08180020..887890ead 100755 --- a/spec/unit/parser/scope_spec.rb +++ b/spec/unit/parser/scope_spec.rb @@ -113,6 +113,15 @@ describe Puppet::Parser::Scope do @scope["var"].should == "childval" end + it "should be able to detect when variables are set" do + @scope["var"] = "childval" + @scope.should be_include("var") + end + + it "should be able to detect when variables are not set" do + @scope.should_not be_include("var") + end + describe "and the variable is qualified" do before do @compiler = Puppet::Parser::Compiler.new(Puppet::Node.new("foonode")) |
