diff options
Diffstat (limited to 'spec/unit/parser/loaded_code.rb')
-rw-r--r-- | spec/unit/parser/loaded_code.rb | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/spec/unit/parser/loaded_code.rb b/spec/unit/parser/loaded_code.rb index ca4b0aaca..75f2bc7e2 100644 --- a/spec/unit/parser/loaded_code.rb +++ b/spec/unit/parser/loaded_code.rb @@ -156,7 +156,24 @@ describe Puppet::Parser::LoadedCode do nameout = Puppet::Parser::AST::HostName.new(:value => "foo") @loader.add_node(namein, "bar") - @loader.node(nameout) == "bar" + @loader.node(nameout).should == "bar" + end + + it "should be able to find node by HostName strict equality" do + namein = Puppet::Parser::AST::HostName.new(:value => "foo") + nameout = Puppet::Parser::AST::HostName.new(:value => "foo") + + @loader.add_node(namein, "bar") + @loader.node_exists?(nameout).should == "bar" + end + + it "should not use node name matching when finding with strict node HostName" do + name1 = Puppet::Parser::AST::HostName.new(:value => "foo") + name2 = Puppet::Parser::AST::HostName.new(:value => Puppet::Parser::AST::Regex.new(:value => /foo/)) + + @loader.add_node(name1, "bar") + @loader.add_node(name2, "baz") + @loader.node_exists?(name1).should == "bar" end it "should return the first matching regex nodename" do |