1 require 'minitest/autorun'
3 require 'active_support'
4 require 'active_support/core_ext'
7 class TestCollectionCreate < Minitest::Test
11 def test_small_collection
12 uuid = Digest::MD5.hexdigest(foo_manifest) + '+' + foo_manifest.size.to_s
13 out, err = capture_subprocess_io do
14 assert_arv('--format', 'uuid', 'collection', 'create', '--collection', {
16 manifest_text: foo_manifest
19 assert /^([0-9a-z]{5}-4zz18-[0-9a-z]{15})?$/.match(out)
23 def test_read_resource_object_from_file
24 tempfile = Tempfile.new('collection')
26 tempfile.write({manifest_text: foo_manifest}.to_json)
28 out, err = capture_subprocess_io do
29 assert_arv('--format', 'uuid',
30 'collection', 'create', '--collection', tempfile.path)
32 assert /^([0-9a-z]{5}-4zz18-[0-9a-z]{15})?$/.match(out)
41 expect = case args.first
48 system(['./bin/arv', 'arv'], *args),
49 "`arv #{args.join ' '}` " +
50 "should exit #{if expect then 0 else 'non-zero' end}")
54 ". #{Digest::MD5.hexdigest('foo')}+3 0:3:foo\n"