diff options
author | Patrick J Cherry <patrick@bytemark.co.uk> | 2017-01-31 12:12:23 +0000 |
---|---|---|
committer | Patrick J Cherry <patrick@bytemark.co.uk> | 2017-01-31 12:12:23 +0000 |
commit | 659a651aa294c335e519b4c72bbd052b3199a793 (patch) | |
tree | a36a95dd652717624034c553bf18c7d66156ccf5 /test/tc_restore.rb | |
parent | 38c89a9e32a67f96b40d756a5c356f8c31247ab9 (diff) |
First pass with rubocoprubocop
Diffstat (limited to 'test/tc_restore.rb')
-rw-r--r-- | test/tc_restore.rb | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/test/tc_restore.rb b/test/tc_restore.rb index 03e98ad..57f7fb9 100644 --- a/test/tc_restore.rb +++ b/test/tc_restore.rb @@ -5,7 +5,6 @@ require 'time' require 'fileutils' class RestoreTest < Test::Unit::TestCase - def setup @byteback_root = Dir.mktmpdir end @@ -19,7 +18,7 @@ class RestoreTest < Test::Unit::TestCase end def test_no_barf_on_non_timestamp_snapshot_name - create_snapshot_and_check_results("saved-hacked-do-not-delete") + create_snapshot_and_check_results('saved-hacked-do-not-delete') end def create_snapshot_and_check_results(snapshot) @@ -31,20 +30,19 @@ class RestoreTest < Test::Unit::TestCase FileUtils.mkdir_p(File.join(@byteback_root, snapshot, File.dirname(f))) FileUtils.touch(File.join(@byteback_root, snapshot, f)) system("setfattr --name user.rsync.%stat -v \"41755 12,34 56:78\" #{File.join(@byteback_root, snapshot, f)}") - assert_equal(0, $?.exitstatus) + assert_equal(0, $CHILD_STATUS.exitstatus) end - r = Byteback::Restore.find(@byteback_root, "*", "/srv/foo.com/public/htdocs/*.html") - assert(r.results.all?{|f| f.path =~ %r{/srv/foo.com/public/htdocs/.*.html}}, "Results returned did not match requested pattern") - assert(r.results.all?{|f| f.snapshot == snapshot}, "Results returned were not from the correct snapshot") + r = Byteback::Restore.find(@byteback_root, '*', '/srv/foo.com/public/htdocs/*.html') + assert(r.results.all? { |f| f.path =~ %r{/srv/foo.com/public/htdocs/.*.html} }, 'Results returned did not match requested pattern') + assert(r.results.all? { |f| f.snapshot == snapshot }, 'Results returned were not from the correct snapshot') # Now check that we're getting the correct stuff from the rsync attr. f = r.results.first - assert_equal(041755, f.mode, "Incorrect mode returned") - assert_equal(12, f.dev_major, "Incorrect dev_major returned") - assert_equal(34, f.dev_minor, "Incorrect dev_minor returned") - assert_equal(56, f.uid, "Incorrect UID returned") - assert_equal(78, f.gid, "Inocrrect GID returned") + assert_equal(041755, f.mode, 'Incorrect mode returned') + assert_equal(12, f.dev_major, 'Incorrect dev_major returned') + assert_equal(34, f.dev_minor, 'Incorrect dev_minor returned') + assert_equal(56, f.uid, 'Incorrect UID returned') + assert_equal(78, f.gid, 'Inocrrect GID returned') end - end |