diff options
| author | Matt Robinson <matt@puppetlabs.com> | 2011-05-19 21:18:55 -0700 |
|---|---|---|
| committer | Matt Robinson <matt@puppetlabs.com> | 2011-05-19 21:18:55 -0700 |
| commit | eeeab02fd97a625ec0e21ecd5d0ed7f0067027ef (patch) | |
| tree | 704477b4d8c2b255707e65135b3bb0d10253e06c /spec/integration/parser/parser_spec.rb | |
| parent | be2f20899d76621db4cf574d074f0ae89777272e (diff) | |
| parent | 99bf07e76bab47760b9eb3dc42f08582c568388f (diff) | |
| download | puppet-eeeab02fd97a625ec0e21ecd5d0ed7f0067027ef.tar.gz puppet-eeeab02fd97a625ec0e21ecd5d0ed7f0067027ef.tar.xz puppet-eeeab02fd97a625ec0e21ecd5d0ed7f0067027ef.zip | |
Merge branch '2.7.next' into 2.7.x
* 2.7.next: (42 commits)
(#6395) Add extpuppet help, eval, and interfaces
Adding a sleep state post starting master
maint: fix spec_helper inclusions again.
(#7523) Refactor the grammar to reduce duplication
(#7114) Fix specs for ssh authorized key parsed provider
(#7114) Target returns correct value
(#7114) Add integration tests for authorized_key
(#7114) Improve unit tests for ssh_authorized_key
(#7114) Improve value validation for authorized_key
(#7300) Fix instances method of mount provider
(#7259) Remove ActiveRecord requirement from indirector face spec
(#7259) Do not try to load all Terminus classes when configuring the Indirector
(#3836) External nodes should only capture stdout
Revert "(#7220) Add the ability to "inherit" options."
maint: sync 'authconfig' to 'rest_authconfig' setting
adding test for ticket 7139
(#7139) Accept '/' as a valid path in filesets
(#7300) Add specs for the mount provider
case seems needless here as there is only two opts, also the rest of the file seems to use if so this should make things more consistant
(#6845) Mount writes incorrect vfstab entries
...
Diffstat (limited to 'spec/integration/parser/parser_spec.rb')
| -rwxr-xr-x | spec/integration/parser/parser_spec.rb | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/spec/integration/parser/parser_spec.rb b/spec/integration/parser/parser_spec.rb index 65c9ee302..b55aa04ce 100755 --- a/spec/integration/parser/parser_spec.rb +++ b/spec/integration/parser/parser_spec.rb @@ -117,5 +117,36 @@ describe Puppet::Parser::Parser do $out = $hash['a']['b']['c'] }.should parse_with { |v| v.value.is_a?(Puppet::Parser::AST::ASTHash) } end + + it "should fail if asked to parse '$foo::::bar'" do + expect { @parser.parse("$foo::::bar") }.should raise_error(Puppet::ParseError, /Syntax error at ':'/) + end + + describe "function calls" do + it "should be able to pass an array to a function" do + "my_function([1,2,3])".should parse_with { |fun| + fun.is_a?(Puppet::Parser::AST::Function) && + fun.arguments.first.evaluate(stub 'scope') == ['1','2','3'] + } + end + + it "should be able to pass a hash to a function" do + "my_function({foo => bar})".should parse_with { |fun| + fun.is_a?(Puppet::Parser::AST::Function) && + fun.arguments.first.evaluate(stub 'scope') == {'foo' => 'bar'} + } + end + end + + describe "collections" do + it "should find resources according to an expression" do + %q{ + File <| mode == 0700 + 0050 + 0050 |> + }.should parse_with { |coll| + coll.is_a?(Puppet::Parser::AST::Collection) && + coll.query.evaluate(stub 'scope').first == "param_values.value = '528' and param_names.name = 'mode'" + } + end + end end end |
