module Kernel
def `(cmd) # override kernel ` method
if cmd.include? 'arv-put'
- ". " +
- Digest::MD5.hexdigest(TEST_MANIFEST) +
- " 0:" + TEST_MANIFEST.length.to_s + ":invalid_manifest_text.txt\n"
+ file_contents = file = File.new(cmd.split[-1], "r").gets
+
+ # simulate arv-put error when it is 'user_agreement'
+ if file_contents.include? 'GNU_General_Public_License'
+ return ''
+ else
+ ". " +
+ Digest::MD5.hexdigest(TEST_MANIFEST) +
+ " 0:" + TEST_MANIFEST.length.to_s + ":invalid_manifest_text.txt\n"
+ end
end
end
end
assert_equal true, exited
end
+
+ test "salvage collection with during arv-put" do
+ # try to salvage collection while mimicking error during arv-put
+ status = SalvageCollection.salvage_collection collections('user_agreement').uuid
+ assert_equal false, status
+ end
end