diff options
author | Luke Kanies <luke@madstop.com> | 2008-03-16 17:37:12 -0500 |
---|---|---|
committer | Luke Kanies <luke@madstop.com> | 2008-03-16 17:37:12 -0500 |
commit | f3a304c557c096b5dbf319671cb84e5611eee30f (patch) | |
tree | b6cf562bdd6ff369922f3498fc216a21e1d655c0 /spec/unit | |
parent | 80f69ce86d245b45aeb93964aed9b3daca7d0d80 (diff) | |
download | puppet-f3a304c557c096b5dbf319671cb84e5611eee30f.tar.gz puppet-f3a304c557c096b5dbf319671cb84e5611eee30f.tar.xz puppet-f3a304c557c096b5dbf319671cb84e5611eee30f.zip |
Modifying the yaml terminus base class to use the timestamp
of the yaml file as the version of the object.
Diffstat (limited to 'spec/unit')
-rwxr-xr-x | spec/unit/indirector/yaml.rb | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/spec/unit/indirector/yaml.rb b/spec/unit/indirector/yaml.rb index 2e0b453d7..b61332485 100755 --- a/spec/unit/indirector/yaml.rb +++ b/spec/unit/indirector/yaml.rb @@ -24,6 +24,16 @@ describe Puppet::Indirector::Yaml, " when choosing file location" do Puppet.settings.stubs(:value).with(:yamldir).returns(@dir) end + it "should use the mtime of the written file as the version" do + stat = mock 'stat' + FileTest.stubs(:exist?).returns true + File.expects(:stat).returns stat + time = Time.now + stat.expects(:mtime).returns time + + @store.version(:me).should equal(time) + end + describe Puppet::Indirector::Yaml, " when choosing file location" do it "should store all files in a single file root set in the Puppet defaults" do @@ -98,4 +108,4 @@ describe Puppet::Indirector::Yaml, " when choosing file location" do proc { @store.find(@subject.name) }.should raise_error(Puppet::Error) end end -end
\ No newline at end of file +end |