diff options
| author | Max Martin <max@puppetlabs.com> | 2011-03-30 13:02:19 -0700 |
|---|---|---|
| committer | Max Martin <max@puppetlabs.com> | 2011-03-30 13:02:19 -0700 |
| commit | 9c06fbd762cddcc41a7185a36f2a8e72879125eb (patch) | |
| tree | bfd37ac5887307857d0b0d79a1db034010eed424 /spec/unit/util | |
| parent | 4196699f5fbb90ceecbb709c8502622eaad39062 (diff) | |
| parent | 11309a214148abb2167c1bd0adba0e035b2d8384 (diff) | |
Merge branch 'next'
* next: (39 commits)
(#5908) Add support for new update-rc.d disable API
(#6830) Fix tests that depended on special inherited behavior
(#6830) Fix overly stubbed tests
(#6830) Fix instance_variables now comes back as symbols
(#6830) Fix badly stubbed Time object in test
(#6830) Fix MD5 handling to work with Ruby 1.9
(#6830) Fix File class scoping
(#6830) Handle case where array is actually a string
(#6830) Fix case where instance_variables returns symbols in Ruby 1.9
(#6862) Add a default subject for the mail_patches rake task
Fixed #6256 - Creation of rrd directory.
(#6855) ResourceType#search now accepts a regex
(#5477) Allow watch_file to watch non-existent files, especially site.pp
(#5477) Allow watch_file to watch non-existent files, especially site.pp
Fixing #6851 - ResourceType#find/search loads types
Fixing Module#path detection
Fixed #6850 - Clean up ResourceType#to_pson
(#6830) Fix stat method calls to not use an unneeded argument
(#4576) Raise an error when a node is classified into a non-existent class
Update CHANGELOG for 2.6.7
...
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 | 7 |
2 files changed, 11 insertions, 3 deletions
diff --git a/spec/unit/util/loadedfile_spec.rb b/spec/unit/util/loadedfile_spec.rb index 23d2766d7..92daeb953 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 ab54c8cd3..f118dc99b 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).returns(Puppet::Parser::AST::Hostclass.new('')) + parser.expects(:parse).returns(Puppet::Parser::AST::Hostclass.new('')).at_least_once parser.expects(:file=).with("module/manifests/init.pp") + parser.expects(:file=).with("/dev/null/manifests/site.pp") @parser.scan end @@ -29,7 +30,7 @@ describe RDoc::Parser do it "should scan the ast for Puppet files" do parser = stub_everything 'parser' Puppet::Parser::Parser.stubs(:new).returns(parser) - parser.expects(:parse).returns(Puppet::Parser::AST::Hostclass.new('')) + parser.expects(:parse).returns(Puppet::Parser::AST::Hostclass.new('')).at_least_once @parser.expects(:scan_top_level) @@ -39,7 +40,7 @@ describe RDoc::Parser do it "should return a PuppetTopLevel to RDoc" do parser = stub_everything 'parser' Puppet::Parser::Parser.stubs(:new).returns(parser) - parser.expects(:parse).returns(Puppet::Parser::AST::Hostclass.new('')) + parser.expects(:parse).returns(Puppet::Parser::AST::Hostclass.new('')).at_least_once @parser.expects(:scan_top_level) |
