diff options
| author | Jesse Wolfe <jes5199@gmail.com> | 2011-03-25 16:10:03 -0700 |
|---|---|---|
| committer | Jesse Wolfe <jes5199@gmail.com> | 2011-03-25 16:10:03 -0700 |
| commit | a2ac367c2bea2b94b88f739250edb828da0091d4 (patch) | |
| tree | c8abe56ae0baf82ef51c5a27a3814bec42a8f890 /spec/unit/util | |
| parent | 0fec21fcd887685cf8421fdc309b878088f9fc48 (diff) | |
| parent | 7c60db5d9db8eeda46f7041100759e69aed120a8 (diff) | |
Merge branch 'ticket/2.6.next/5477' into 2.6.next
Diffstat (limited to 'spec/unit/util')
| -rwxr-xr-x | spec/unit/util/loadedfile_spec.rb | 7 | ||||
| -rwxr-xr-x | spec/unit/util/rdoc/parser_spec.rb | 3 |
2 files changed, 9 insertions, 1 deletions
diff --git a/spec/unit/util/loadedfile_spec.rb b/spec/unit/util/loadedfile_spec.rb index 3bc26a421..c6fd625fc 100755 --- a/spec/unit/util/loadedfile_spec.rb +++ b/spec/unit/util/loadedfile_spec.rb @@ -6,6 +6,7 @@ require 'tempfile' require 'puppet/util/loadedfile' describe Puppet::Util::LoadedFile do + include PuppetSpec::Files before(:each) do @f = Tempfile.new('loadedfile_test') @f.puts "yayness" @@ -18,6 +19,12 @@ describe Puppet::Util::LoadedFile do @fake_now = Time.now + (2 * Puppet[:filetimeout]) end + it "should accept files that don't exist" do + nofile = tmpfile('testfile') + File.exists?(nofile).should == false + lambda{ Puppet::Util::LoadedFile.new(nofile) }.should_not raise_error + end + it "should recognize when the file has not changed" do # Use fake "now" so that we can be sure changed? actually checks, without sleeping # for Puppet[:filetimeout] seconds. diff --git a/spec/unit/util/rdoc/parser_spec.rb b/spec/unit/util/rdoc/parser_spec.rb index b4453ae86..6ae28b40a 100755 --- a/spec/unit/util/rdoc/parser_spec.rb +++ b/spec/unit/util/rdoc/parser_spec.rb @@ -20,8 +20,9 @@ describe RDoc::Parser do @parser.stubs(:scan_top_level) parser = stub 'parser' Puppet::Parser::Parser.stubs(:new).returns(parser) - parser.expects(:parse) + parser.expects(:parse).at_least_once parser.expects(:file=).with("module/manifests/init.pp") + parser.expects(:file=).with("/dev/null/manifests/site.pp") @parser.scan end |
