summaryrefslogtreecommitdiffstats
path: root/spec/unit/parser
diff options
context:
space:
mode:
authorMatt Robinson <matt@puppetlabs.com>2011-03-06 20:42:39 -0800
committerMatt Robinson <matt@puppetlabs.com>2011-03-07 14:02:17 -0800
commit28095d7435bcab15b76ddfa4435d61653f2f890d (patch)
tree74ae5f037aaee78ed31de178c6e6f4203e9d7959 /spec/unit/parser
parent6869385300dc694c4f087e134949dff9e1e43df9 (diff)
parente8145f91debc863b341a270e1d8cff6c43d93ef5 (diff)
downloadpuppet-28095d7435bcab15b76ddfa4435d61653f2f890d.tar.gz
puppet-28095d7435bcab15b76ddfa4435d61653f2f890d.tar.xz
puppet-28095d7435bcab15b76ddfa4435d61653f2f890d.zip
Merge branch '2.6.next' into next
This was a particularly nasty merge, so rather than hold up merges into next any longer, I'm going to push this merge with a few outstanding problems. The tests that were failing in the following areas have been marked pending, and will be addressed separately, immediately following this push. TODO: Verify that brice's rdoc change is still valid: tests to show that line numbers from class, define and node get into the ast Fix mount parsed_spec spec/unit/provider/mount/parsed_spec.rb * 2.6.next: (85 commits) (#5148) Fix failing spec due to timezone (#5148) Add support for PSON to facts (#6338) Remove inventory indirection, and move to facts indirection (#6445) Fix inline docs: puppet agent does not accept --mkusers Update CHANGELOG and version for 2.6.6rc1 (#6541) Fix content with checksum truncation bug (#6418) Recursive files shouldn't be audited (#6541) maint: whitespace cleanup on the file integration spec (#6541) Fix content with checksum truncation bug (#5466) Write specs for output of puppet resource (#5466) Monkey patch Symbol so that you can sort them (#5466) Fixed puppet resource bug with trailing , Update CHANGELOG for 2.6.5 (#4922) Don't truncate remotely-sourced files on 404 (#6338) Remove unused version control tags Maint: Align tabs in a code block in the Augeas type. (#6509) Inline docs: Fix erroneous code block in directoryservice provider for computer type Maint: Rewrite comments about symlinks to reflect best practice. (#6509) Inline docs: Fix broken lists in Launchd provider. (#6509) Inline docs: Fix broken code blocks in zpool type ... Manually Resolved Conflicts: lib/puppet/application/inspect.rb lib/puppet/defaults.rb lib/puppet/file_bucket/dipper.rb lib/puppet/network/http/handler.rb lib/puppet/node/facts.rb lib/puppet/parser/parser.rb lib/puppet/parser/parser_support.rb lib/puppet/util/command_line/puppet lib/puppet/util/command_line/puppetd lib/puppet/util/command_line/puppetmasterd lib/puppet/util/monkey_patches.rb lib/puppet/util/rdoc/parser.rb spec/unit/application/agent_spec.rb spec/unit/file_bucket/file_spec.rb spec/unit/indirector/file_bucket_file/file_spec.rb spec/unit/network/http/handler_spec.rb spec/unit/parser/parser_spec.rb spec/unit/provider/mount/parsed_spec.rb
Diffstat (limited to 'spec/unit/parser')
-rwxr-xr-xspec/unit/parser/lexer_spec.rb16
-rwxr-xr-xspec/unit/parser/parser_spec.rb8
2 files changed, 23 insertions, 1 deletions
diff --git a/spec/unit/parser/lexer_spec.rb b/spec/unit/parser/lexer_spec.rb
index b8254f2e0..96df61348 100755
--- a/spec/unit/parser/lexer_spec.rb
+++ b/spec/unit/parser/lexer_spec.rb
@@ -529,6 +529,22 @@ describe Puppet::Parser::Lexer, "when lexing comments" do
@lexer.fullscan
end
+ it "should add a new comment stack level on LPAREN" do
+ @lexer.string = "("
+
+ @lexer.expects(:commentpush)
+
+ @lexer.fullscan
+ end
+
+ it "should pop the current comment on RPAREN" do
+ @lexer.string = ")"
+
+ @lexer.expects(:commentpop)
+
+ @lexer.fullscan
+ end
+
it "should return the current comments on getcomment" do
@lexer.string = "# comment"
@lexer.fullscan
diff --git a/spec/unit/parser/parser_spec.rb b/spec/unit/parser/parser_spec.rb
index d5861d7db..233de23c0 100755
--- a/spec/unit/parser/parser_spec.rb
+++ b/spec/unit/parser/parser_spec.rb
@@ -78,6 +78,12 @@ describe Puppet::Parser do
end
+ describe "when parsing selector" do
+ it "should support hash access on the left hand side" do
+ lambda { @parser.parse("$h = { 'a' => 'b' } $a = $h['a'] ? { 'b' => 'd', default => undef }") }.should_not raise_error
+ end
+ end
+
describe "when parsing 'if'" do
it "not, it should create the correct ast objects" do
Puppet::Parser::AST::Not.expects(:new).with { |h| h[:value].is_a?(Puppet::Parser::AST::Boolean) }
@@ -281,7 +287,7 @@ describe Puppet::Parser do
it "should include docs when the AST class uses them" do
@class.expects(:use_docs).returns true
@class.stubs(:new)
- @parser.expects(:ast_context).with{ |*a| a[0] == true }.returns({})
+ @parser.expects(:ast_context).with{ |docs, line| docs == true }.returns({})
@parser.ast(@class, :file => "/bar")
end