summaryrefslogtreecommitdiff
path: root/spec/unit/util
diff options
context:
space:
mode:
authorsawanoboly <sawanoboriyu@higanworks.com>2013-09-08 16:21:34 +0900
committerBryan McLellan <btm@opscode.com>2013-10-04 09:52:09 -0700
commite852026aece6b50d6f05ed11949f191ac5b0890d (patch)
tree2a159c6385e73eaceef2754435c325b70c97f8a0 /spec/unit/util
parent83796f4cfa46deebcd233a030fad5f0199df94e4 (diff)
downloadchef-e852026aece6b50d6f05ed11949f191ac5b0890d.tar.gz
[CHEF-4529]
backup filename minutely. backup filename minutely. Fix: fail on 1.8.7 code cleanup
Diffstat (limited to 'spec/unit/util')
-rw-r--r--spec/unit/util/backup_spec.rb12
1 files changed, 6 insertions, 6 deletions
diff --git a/spec/unit/util/backup_spec.rb b/spec/unit/util/backup_spec.rb
index cbb91e6c04..c49694f924 100644
--- a/spec/unit/util/backup_spec.rb
+++ b/spec/unit/util/backup_spec.rb
@@ -107,15 +107,15 @@ describe Chef::Util::Backup do
describe "backup_filename" do
it "should return a timestamped path" do
@backup.should_receive(:path).and_return('/a/b/c.txt')
- @backup.send(:backup_filename).should =~ %r|^/a/b/c.txt.chef-\d{14}$|
+ @backup.send(:backup_filename).should =~ %r|^/a/b/c.txt.chef-\d{14}.\d{6}$|
end
it "should strip the drive letter off for windows" do
@backup.should_receive(:path).and_return('c:\a\b\c.txt')
- @backup.send(:backup_filename).should =~ %r|^\\a\\b\\c.txt.chef-\d{14}$|
+ @backup.send(:backup_filename).should =~ %r|^\\a\\b\\c.txt.chef-\d{14}.\d{6}$|
end
it "should strip the drive letter off for windows (with forwardslashes)" do
@backup.should_receive(:path).and_return('c:/a/b/c.txt')
- @backup.send(:backup_filename).should =~ %r|^/a/b/c.txt.chef-\d{14}$|
+ @backup.send(:backup_filename).should =~ %r|^/a/b/c.txt.chef-\d{14}.\d{6}$|
end
end
@@ -123,19 +123,19 @@ describe Chef::Util::Backup do
it "uses the file's directory when Chef::Config[:file_backup_path] is nil" do
@backup.should_receive(:path).and_return('/a/b/c.txt')
Chef::Config[:file_backup_path] = nil
- @backup.send(:backup_path).should =~ %r|^/a/b/c.txt.chef-\d{14}$|
+ @backup.send(:backup_path).should =~ %r|^/a/b/c.txt.chef-\d{14}.\d{6}$|
end
it "uses the configured Chef::Config[:file_backup_path]" do
@backup.should_receive(:path).and_return('/a/b/c.txt')
Chef::Config[:file_backup_path] = '/backupdir'
- @backup.send(:backup_path).should =~ %r|^/backupdir[\\/]+a/b/c.txt.chef-\d{14}$|
+ @backup.send(:backup_path).should =~ %r|^/backupdir[\\/]+a/b/c.txt.chef-\d{14}.\d{6}$|
end
it "uses the configured Chef::Config[:file_backup_path] and strips the drive on windows" do
@backup.should_receive(:path).and_return('c:\\a\\b\\c.txt')
Chef::Config[:file_backup_path] = 'c:\backupdir'
- @backup.send(:backup_path).should =~ %r|^c:\\backupdir[\\/]+a\\b\\c.txt.chef-\d{14}$|
+ @backup.send(:backup_path).should =~ %r|^c:\\backupdir[\\/]+a\\b\\c.txt.chef-\d{14}.\d{6}$|
end
end