summaryrefslogtreecommitdiffstats
path: root/spec/unit/parser
diff options
context:
space:
mode:
authorMax Martin <max@puppetlabs.com>2011-03-30 13:00:56 -0700
committerMax Martin <max@puppetlabs.com>2011-03-30 13:00:56 -0700
commit9d17809e5b240aa80d2c30f4d9625d4812802b8f (patch)
treef2c9101dbf36c9fcbf51454c9baca9a7d92cb667 /spec/unit/parser
parent76b3ee6822f52b100c45cd8921f13739f12ddf38 (diff)
parentf5170fc2dbcbb4202b9b08e8944aa35f7a7bf7b8 (diff)
downloadpuppet-9d17809e5b240aa80d2c30f4d9625d4812802b8f.tar.gz
puppet-9d17809e5b240aa80d2c30f4d9625d4812802b8f.tar.xz
puppet-9d17809e5b240aa80d2c30f4d9625d4812802b8f.zip
Merge branch '2.6.next' into 2.6.x
* 2.6.next: (23 commits) (#5908) Add support for new update-rc.d disable API (#6862) Add a default subject for the mail_patches rake task Fixed #6256 - Creation of rrd directory. (#5477) Allow watch_file to watch non-existent files, especially site.pp (#5221) Add test for fix to fileset with trailing separator (#5221) Fix fileset path absoluteness checking with trailing slash (#4769) Fix negative timeout support for newer rubies Fixed #6562 - Minor kick documentation fix (#6658) Propagate ENC connection errors to the agent (#4884) Remove typo from spec test (#4884) Modify tests to pass on non-OS X systems (#4884) Revise new exec tests, add a few more (4576) - if ENC declares invalid class, it is logged at warning. (#4884) Add an shell provider for execs (#4884) Fix Test::Unit exec tests (#4884) Break the exec type out to have a posix provider (#4884) Add consistent path validation and behavior (#4884) Add expand_path to requiring the spec_helper (#4884) Autorequire shared behaviors and method to silence warnings (#4884) Fix whitespace ...
Diffstat (limited to 'spec/unit/parser')
-rwxr-xr-xspec/unit/parser/compiler_spec.rb3
-rwxr-xr-xspec/unit/parser/lexer_spec.rb12
2 files changed, 13 insertions, 2 deletions
diff --git a/spec/unit/parser/compiler_spec.rb b/spec/unit/parser/compiler_spec.rb
index 687f2ecb9..261cfdec1 100755
--- a/spec/unit/parser/compiler_spec.rb
+++ b/spec/unit/parser/compiler_spec.rb
@@ -581,12 +581,11 @@ describe Puppet::Parser::Compiler do
@scope.expects(:find_hostclass).with("notfound").returns(nil)
@compiler.evaluate_classes(%w{notfound}, @scope)
end
- # I wish it would fail
it "should log when it can't find class" do
klasses = {'foo'=>nil}
@node.classes = klasses
@compiler.topscope.stubs(:find_hostclass).with('foo').returns(nil)
- Puppet.expects(:info).with('Could not find class foo for testnode')
+ Puppet.expects(:warning).with('Could not find class foo for testnode')
@compiler.compile
end
end
diff --git a/spec/unit/parser/lexer_spec.rb b/spec/unit/parser/lexer_spec.rb
index 4ef242cf5..d144504c5 100755
--- a/spec/unit/parser/lexer_spec.rb
+++ b/spec/unit/parser/lexer_spec.rb
@@ -679,3 +679,15 @@ describe "Puppet::Parser::Lexer in the old tests when lexing example files" do
end
end
end
+
+describe "when trying to lex an non-existent file" do
+ include PuppetSpec::Files
+
+ it "should return an empty list of tokens" do
+ lexer = Puppet::Parser::Lexer.new
+ lexer.file = nofile = tmpfile('lexer')
+ File.exists?(nofile).should == false
+
+ lexer.fullscan.should == [[false,false]]
+ end
+end