heirloom 0.12.1 → 0.12.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.ruby-version +1 -1
- data/.travis.yml +1 -0
- data/CHANGELOG.md +6 -0
- data/README.md +12 -6
- data/heirloom.gemspec +3 -5
- data/lib/heirloom/catalog/verify.rb +2 -2
- data/lib/heirloom/cli/authorize.rb +1 -2
- data/lib/heirloom/cli/catalog.rb +62 -19
- data/lib/heirloom/cli/cleanup.rb +1 -2
- data/lib/heirloom/cli/destroy.rb +1 -2
- data/lib/heirloom/cli/download.rb +2 -3
- data/lib/heirloom/cli/formatter/catalog.rb +25 -11
- data/lib/heirloom/cli/list.rb +1 -3
- data/lib/heirloom/cli/rotate.rb +1 -2
- data/lib/heirloom/cli/setup.rb +1 -2
- data/lib/heirloom/cli/shared.rb +3 -0
- data/lib/heirloom/cli/show.rb +1 -3
- data/lib/heirloom/cli/tag.rb +1 -2
- data/lib/heirloom/cli/teardown.rb +1 -2
- data/lib/heirloom/cli/upload.rb +1 -2
- data/lib/heirloom/version.rb +1 -1
- data/spec/acl/s3_spec.rb +11 -11
- data/spec/archive/authorizer_spec.rb +20 -20
- data/spec/archive/builder_spec.rb +13 -13
- data/spec/archive/checker_spec.rb +24 -24
- data/spec/archive/destroyer_spec.rb +20 -20
- data/spec/archive/downloader_spec.rb +30 -30
- data/spec/archive/lister_spec.rb +7 -7
- data/spec/archive/reader_spec.rb +65 -65
- data/spec/archive/setup_spec.rb +27 -27
- data/spec/archive/teardowner_spec.rb +19 -19
- data/spec/archive/updater_spec.rb +10 -10
- data/spec/archive/uploader_spec.rb +26 -26
- data/spec/archive/verifier_spec.rb +25 -25
- data/spec/archive/writer_spec.rb +11 -11
- data/spec/archive_spec.rb +91 -93
- data/spec/aws/s3_spec.rb +102 -102
- data/spec/aws/simpledb_spec.rb +33 -63
- data/spec/catalog/add_spec.rb +12 -12
- data/spec/catalog/delete_spec.rb +14 -14
- data/spec/catalog/list_spec.rb +8 -8
- data/spec/catalog/setup_spec.rb +11 -11
- data/spec/catalog/show_spec.rb +13 -13
- data/spec/catalog/verify_spec.rb +16 -16
- data/spec/catalog_spec.rb +36 -36
- data/spec/cipher/data_spec.rb +19 -19
- data/spec/cipher/file_spec.rb +11 -11
- data/spec/cli/authorize_spec.rb +16 -16
- data/spec/cli/catalog_spec.rb +18 -34
- data/spec/cli/destroy_spec.rb +13 -13
- data/spec/cli/download_spec.rb +31 -31
- data/spec/cli/formatter/catalog_spec.rb +19 -17
- data/spec/cli/list_spec.rb +14 -14
- data/spec/cli/rotate_spec.rb +9 -9
- data/spec/cli/setup_spec.rb +29 -29
- data/spec/cli/shared_spec.rb +119 -119
- data/spec/cli/show_spec.rb +20 -20
- data/spec/cli/tag_spec.rb +18 -18
- data/spec/cli/teardown_spec.rb +28 -28
- data/spec/cli/upload_spec.rb +38 -38
- data/spec/config_spec.rb +21 -21
- data/spec/destroyer/s3_spec.rb +6 -6
- data/spec/directory/directory_spec.rb +19 -19
- data/spec/downloader/s3_spec.rb +18 -18
- data/spec/logger_spec.rb +9 -9
- data/spec/spec_helper.rb +4 -80
- data/spec/uploader/s3_spec.rb +35 -35
- metadata +23 -56
- data/spec/integration/authorize_spec.rb +0 -79
- data/spec/integration/cleanup_spec.rb +0 -77
- data/watchr.rb +0 -101
data/spec/cipher/file_spec.rb
CHANGED
@@ -2,15 +2,15 @@ require 'spec_helper'
|
|
2
2
|
|
3
3
|
describe Heirloom do
|
4
4
|
before do
|
5
|
-
@
|
6
|
-
@
|
7
|
-
|
8
|
-
@
|
9
|
-
@
|
10
|
-
@
|
11
|
-
|
12
|
-
Tempfile.stub :new => @
|
13
|
-
@file = Heirloom::Cipher::File.new :config => @
|
5
|
+
@logger_double = double 'logger', :info => true
|
6
|
+
@logger_double.stub :info => true,
|
7
|
+
:debug => true
|
8
|
+
@config_double = double 'config'
|
9
|
+
@config_double.stub :logger => @logger_double
|
10
|
+
@tempfile_double = double 'tempfile', :path => '/path_to_encrypted_archive',
|
11
|
+
:close! => true
|
12
|
+
Tempfile.stub :new => @tempfile_double
|
13
|
+
@file = Heirloom::Cipher::File.new :config => @config_double
|
14
14
|
end
|
15
15
|
|
16
16
|
it "should encrypt the given file" do
|
@@ -26,14 +26,14 @@ describe Heirloom do
|
|
26
26
|
|
27
27
|
it "should return false if gpg is not in the path" do
|
28
28
|
@file.should_receive(:which).with('gpg').and_return false
|
29
|
-
@
|
29
|
+
@logger_double.should_receive(:error)
|
30
30
|
@file.encrypt_file(:file => '/file',
|
31
31
|
:secret => 'mysecret').should be_false
|
32
32
|
end
|
33
33
|
|
34
34
|
it "should return false if gpg returns non zero code" do
|
35
35
|
@file.should_receive(:which).with('gpg').and_return true
|
36
|
-
@
|
36
|
+
@logger_double.should_receive(:error)
|
37
37
|
command = 'gpg --batch --yes -c --cipher-algo AES256 --passphrase mysecret --output /path_to_encrypted_archive /file 2>&1'
|
38
38
|
@file.should_receive(:`).with command
|
39
39
|
$?.stub :success? => false
|
data/spec/cli/authorize_spec.rb
CHANGED
@@ -9,39 +9,39 @@ describe Heirloom do
|
|
9
9
|
:name => 'archive_name',
|
10
10
|
:id => '1.0.0',
|
11
11
|
:metadata_region => 'us-west-1' }
|
12
|
-
@
|
13
|
-
@
|
14
|
-
@
|
12
|
+
@logger_double = double 'logger', :error => true
|
13
|
+
@config_double = double_config :logger => @logger_double
|
14
|
+
@archive_double = double 'archive'
|
15
15
|
Trollop.stub(:options).and_return options
|
16
16
|
Heirloom::HeirloomLogger.should_receive(:new).with(:log_level => 'info').
|
17
|
-
and_return @
|
17
|
+
and_return @logger_double
|
18
18
|
Heirloom::CLI::Authorize.any_instance.should_receive(:load_config).
|
19
|
-
with(:logger => @
|
19
|
+
with(:logger => @logger_double,
|
20
20
|
:opts => options).
|
21
|
-
and_return @
|
21
|
+
and_return @config_double
|
22
22
|
Heirloom::Archive.should_receive(:new).
|
23
23
|
with(:name => 'archive_name',
|
24
|
-
:config => @
|
25
|
-
and_return @
|
24
|
+
:config => @config_double).
|
25
|
+
and_return @archive_double
|
26
26
|
Heirloom::Archive.should_receive(:new).
|
27
27
|
with(:id => '1.0.0',
|
28
28
|
:name => 'archive_name',
|
29
|
-
:config => @
|
30
|
-
and_return @
|
31
|
-
@
|
32
|
-
@
|
29
|
+
:config => @config_double).
|
30
|
+
and_return @archive_double
|
31
|
+
@archive_double.stub :exists? => true
|
32
|
+
@archive_double.should_receive(:domain_exists?).and_return true
|
33
33
|
@cli_authorize = Heirloom::CLI::Authorize.new
|
34
34
|
end
|
35
35
|
|
36
36
|
it "should authorize an account" do
|
37
|
-
@
|
38
|
-
|
37
|
+
@archive_double.should_receive(:authorize).with(['test@test.com']).
|
38
|
+
and_return true
|
39
39
|
@cli_authorize.authorize
|
40
40
|
end
|
41
41
|
|
42
42
|
it "should exit if authorize returns false" do
|
43
|
-
@
|
44
|
-
|
43
|
+
@archive_double.should_receive(:authorize).with(['test@test.com']).
|
44
|
+
and_return false
|
45
45
|
lambda { @cli_authorize.authorize }.should raise_error SystemExit
|
46
46
|
end
|
47
47
|
|
data/spec/cli/catalog_spec.rb
CHANGED
@@ -6,53 +6,37 @@ describe Heirloom do
|
|
6
6
|
before do
|
7
7
|
@options = { :level => 'info',
|
8
8
|
:metadata_region => 'us-west-1' }
|
9
|
-
|
9
|
+
|
10
|
+
@result = { 'heirloom_test' =>
|
10
11
|
{ 'regions' => ['us-west-1'],
|
11
12
|
'bucket_prefix' => ['bp'] } }
|
12
|
-
@
|
13
|
-
@
|
14
|
-
@
|
15
|
-
@
|
13
|
+
@logger_double = double :debug => true
|
14
|
+
@config_double = double_config :logger => @logger_double
|
15
|
+
@catalog_double = double 'catalog'
|
16
|
+
@catalog_double.stub :catalog_domain_exists? => true
|
16
17
|
Heirloom::HeirloomLogger.should_receive(:new).with(:log_level => 'info').
|
17
|
-
and_return @
|
18
|
+
and_return @logger_double
|
18
19
|
Heirloom::CLI::Catalog.any_instance.should_receive(:load_config).
|
19
|
-
with(:logger => @
|
20
|
+
with(:logger => @logger_double,
|
20
21
|
:opts => @options).
|
21
|
-
and_return @
|
22
|
+
and_return @config_double
|
22
23
|
Heirloom::Catalog.should_receive(:new).
|
23
|
-
with(:config => @
|
24
|
-
and_return @
|
25
|
-
end
|
26
|
-
|
27
|
-
context "as json" do
|
28
|
-
before do
|
29
|
-
@options[:json] = true
|
30
|
-
Trollop.stub :options => @options
|
31
|
-
end
|
32
|
-
|
33
|
-
it "should list the details about all heirlooms in the catalog" do
|
34
|
-
@cli_catalog = Heirloom::CLI::Catalog.new
|
35
|
-
@catalog_mock.stub :all => @result
|
36
|
-
formated_result = { 'test' =>
|
37
|
-
{ 'regions' => ['us-west-1'],
|
38
|
-
'bucket_prefix' => ['bp'] } }
|
39
|
-
@cli_catalog.should_receive(:jj).with formated_result
|
40
|
-
@cli_catalog.all
|
41
|
-
end
|
24
|
+
with(:config => @config_double).
|
25
|
+
and_return @catalog_double
|
42
26
|
end
|
43
27
|
|
44
28
|
context "as human readable" do
|
45
29
|
before do
|
46
|
-
@options[:json] = nil
|
47
30
|
Trollop.stub :options => @options
|
48
31
|
end
|
49
32
|
|
50
33
|
it "should list all heirlooms in the catalog" do
|
51
34
|
@cli_catalog = Heirloom::CLI::Catalog.new
|
52
|
-
@
|
53
|
-
|
54
|
-
catalog = { :
|
55
|
-
|
35
|
+
@catalog_double.stub :all => @result
|
36
|
+
formatter_double = double 'formatter'
|
37
|
+
catalog = { :region => "us-west-1",
|
38
|
+
:catalog =>
|
39
|
+
{ "heirloom_test" =>
|
56
40
|
{
|
57
41
|
"regions" => ["us-west-1"],
|
58
42
|
"bucket_prefix" => ["bp"]
|
@@ -60,8 +44,8 @@ describe Heirloom do
|
|
60
44
|
},
|
61
45
|
:name => nil
|
62
46
|
}
|
63
|
-
Heirloom::CLI::Formatter::Catalog.stub :new =>
|
64
|
-
|
47
|
+
Heirloom::CLI::Formatter::Catalog.stub :new => formatter_double
|
48
|
+
formatter_double.should_receive(:summary_format).with(:region=>"us-west-1").and_return('theoutput')
|
65
49
|
@cli_catalog.should_receive(:puts).with 'theoutput'
|
66
50
|
@cli_catalog.all
|
67
51
|
end
|
data/spec/cli/destroy_spec.rb
CHANGED
@@ -8,32 +8,32 @@ describe Heirloom do
|
|
8
8
|
:id => '1.0.0',
|
9
9
|
:level => 'info',
|
10
10
|
:metadata_region => 'us-west-1' }
|
11
|
-
@
|
12
|
-
@
|
13
|
-
@
|
11
|
+
@logger_double = double 'logger'
|
12
|
+
@config_double = double_config :logger => @logger_double
|
13
|
+
@archive_double = double 'archive'
|
14
14
|
Trollop.stub(:options).and_return options
|
15
15
|
Heirloom::HeirloomLogger.should_receive(:new).with(:log_level => 'info').
|
16
|
-
and_return @
|
16
|
+
and_return @logger_double
|
17
17
|
Heirloom::CLI::Destroy.any_instance.should_receive(:load_config).
|
18
|
-
with(:logger => @
|
18
|
+
with(:logger => @logger_double,
|
19
19
|
:opts => options).
|
20
|
-
and_return @
|
20
|
+
and_return @config_double
|
21
21
|
Heirloom::Archive.should_receive(:new).
|
22
22
|
with(:name => 'archive_name',
|
23
|
-
:config => @
|
24
|
-
and_return @
|
23
|
+
:config => @config_double).
|
24
|
+
and_return @archive_double
|
25
25
|
Heirloom::Archive.should_receive(:new).
|
26
26
|
with(:id => '1.0.0',
|
27
27
|
:name => 'archive_name',
|
28
|
-
:config => @
|
29
|
-
and_return @
|
30
|
-
@
|
31
|
-
@
|
28
|
+
:config => @config_double).
|
29
|
+
and_return @archive_double
|
30
|
+
@archive_double.stub :exists? => true
|
31
|
+
@archive_double.should_receive(:domain_exists?).and_return true
|
32
32
|
@cli_destroy = Heirloom::CLI::Destroy.new
|
33
33
|
end
|
34
34
|
|
35
35
|
it "should destroy an archive" do
|
36
|
-
@
|
36
|
+
@archive_double.should_receive(:destroy)
|
37
37
|
@cli_destroy.destroy
|
38
38
|
end
|
39
39
|
|
data/spec/cli/download_spec.rb
CHANGED
@@ -4,17 +4,17 @@ require 'heirloom/cli'
|
|
4
4
|
describe Heirloom do
|
5
5
|
|
6
6
|
before do
|
7
|
-
@
|
8
|
-
@
|
9
|
-
@
|
7
|
+
@logger_double = double 'logger'
|
8
|
+
@config_double = double_config :logger => @logger_double
|
9
|
+
@archive_double = double 'archive'
|
10
10
|
Heirloom::HeirloomLogger.should_receive(:new).
|
11
11
|
with(:log_level => 'info').
|
12
|
-
and_return @
|
12
|
+
and_return @logger_double
|
13
13
|
Heirloom::Archive.should_receive(:new).
|
14
|
-
with(:id
|
15
|
-
:name
|
16
|
-
:config => @
|
17
|
-
and_return @
|
14
|
+
with(:id => '1.0.0',
|
15
|
+
:name => 'archive_name',
|
16
|
+
:config => @config_double).
|
17
|
+
and_return @archive_double
|
18
18
|
end
|
19
19
|
|
20
20
|
context "with id, region and bucket_prefix specified" do
|
@@ -29,25 +29,25 @@ describe Heirloom do
|
|
29
29
|
:metadata_region => 'us-west-1' }
|
30
30
|
Trollop.stub(:options).and_return options
|
31
31
|
Heirloom::CLI::Download.any_instance.should_receive(:load_config).
|
32
|
-
with(:logger => @
|
32
|
+
with(:logger => @logger_double,
|
33
33
|
:opts => options).
|
34
|
-
and_return @
|
34
|
+
and_return @config_double
|
35
35
|
@cli_download = Heirloom::CLI::Download.new
|
36
36
|
end
|
37
37
|
|
38
38
|
it "should download an archive" do
|
39
|
-
@
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
39
|
+
@archive_double.should_receive(:download).with(:output => '/tmp/test123',
|
40
|
+
:region => 'us-east-1',
|
41
|
+
:bucket_prefix => 'bp',
|
42
|
+
:extract => false,
|
43
|
+
:secret => nil).
|
44
44
|
and_return '/tmp/test123'
|
45
45
|
@cli_download.should_receive(:ensure_path_is_directory).
|
46
|
-
with(:config => @
|
46
|
+
with(:config => @config_double,
|
47
47
|
:path => '/tmp/test123').
|
48
48
|
and_return true
|
49
49
|
@cli_download.should_receive(:ensure_directory_is_writable).
|
50
|
-
with(:config => @
|
50
|
+
with(:config => @config_double,
|
51
51
|
:path => '/tmp/test123').
|
52
52
|
and_return true
|
53
53
|
@cli_download.download
|
@@ -56,9 +56,9 @@ describe Heirloom do
|
|
56
56
|
|
57
57
|
context "id, region and bucket prefix not specified" do
|
58
58
|
before do
|
59
|
-
@
|
60
|
-
|
61
|
-
@
|
59
|
+
@catalog_double = double 'catalog', :regions => ['us-east-1', 'us-west-1'],
|
60
|
+
:bucket_prefix => 'bp'
|
61
|
+
@archive_double.stub :exists? => true
|
62
62
|
options = { :name => 'archive_name',
|
63
63
|
:level => 'info',
|
64
64
|
:output => '/tmp/test123',
|
@@ -67,34 +67,34 @@ describe Heirloom do
|
|
67
67
|
:metadata_region => 'us-west-1' }
|
68
68
|
Trollop.stub(:options).and_return options
|
69
69
|
Heirloom::CLI::Download.any_instance.should_receive(:load_config).
|
70
|
-
with(:logger => @
|
70
|
+
with(:logger => @logger_double,
|
71
71
|
:opts => options).
|
72
|
-
and_return @
|
72
|
+
and_return @config_double
|
73
73
|
Heirloom::Catalog.should_receive(:new).
|
74
74
|
with(:name => 'archive_name',
|
75
|
-
:config => @
|
76
|
-
and_return @
|
77
|
-
|
75
|
+
:config => @config_double).
|
76
|
+
and_return @catalog_double
|
77
|
+
archive_double_to_lookup_latest = double 'latest', :list => ['1.0.0']
|
78
78
|
Heirloom::Archive.should_receive(:new).
|
79
79
|
with(:name => 'archive_name',
|
80
|
-
:config => @
|
81
|
-
and_return
|
80
|
+
:config => @config_double).
|
81
|
+
and_return archive_double_to_lookup_latest
|
82
82
|
@cli_download = Heirloom::CLI::Download.new
|
83
83
|
end
|
84
84
|
|
85
85
|
it "should download the latest archive from the first region" do
|
86
|
-
@
|
86
|
+
@archive_double.should_receive(:download).with(:output => '/tmp/test123',
|
87
87
|
:region => 'us-east-1',
|
88
88
|
:bucket_prefix => 'bp',
|
89
89
|
:extract => false,
|
90
90
|
:secret => nil).
|
91
|
-
|
91
|
+
and_return '/tmp/test123'
|
92
92
|
@cli_download.should_receive(:ensure_path_is_directory).
|
93
|
-
with(:config => @
|
93
|
+
with(:config => @config_double,
|
94
94
|
:path => '/tmp/test123').
|
95
95
|
and_return true
|
96
96
|
@cli_download.should_receive(:ensure_directory_is_writable).
|
97
|
-
with(:config => @
|
97
|
+
with(:config => @config_double,
|
98
98
|
:path => '/tmp/test123').
|
99
99
|
and_return true
|
100
100
|
@cli_download.download
|
@@ -4,39 +4,41 @@ require 'heirloom/cli'
|
|
4
4
|
describe Heirloom do
|
5
5
|
|
6
6
|
before do
|
7
|
-
|
7
|
+
|
8
|
+
@catalog = { 'heirloom_test1' =>
|
8
9
|
{ 'regions' => ['us-west-1', 'us-east-1'],
|
9
10
|
'bucket_prefix' => ['bp1'] },
|
10
|
-
'
|
11
|
+
'heirloom_test2' =>
|
11
12
|
{ 'regions' => ['us-west-2'],
|
12
13
|
'bucket_prefix' => ['bp2'] }
|
13
14
|
}
|
14
|
-
@formatter = Heirloom::CLI::Formatter::Catalog.new
|
15
|
+
@formatter = Heirloom::CLI::Formatter::Catalog.new :catalog => @catalog
|
16
|
+
|
17
|
+
|
15
18
|
end
|
16
19
|
|
17
20
|
context "unfiltered" do
|
18
|
-
it "should return the
|
19
|
-
|
21
|
+
it "should return the summary formatted list" do
|
22
|
+
|
23
|
+
@formatter.summary_format(:region => 'us-west-1',
|
20
24
|
:details => nil,
|
21
|
-
:name => nil ).should == "test1\
|
25
|
+
:name => nil ).should == "us-west-1\n test1\n test2"
|
22
26
|
end
|
23
27
|
end
|
24
28
|
|
25
29
|
context "filtered" do
|
26
|
-
it "should return the name with details" do
|
30
|
+
it "should return the name with details when passed in the name and region" do
|
27
31
|
format = "test1\n" +
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
32
|
+
" metadata_region : us-west-1\n" +
|
33
|
+
" regions : us-east-1, us-west-1\n" +
|
34
|
+
" bucket_prefix : bp1\n" +
|
35
|
+
" us-east-1-s3-url : s3://bp1-us-east-1/test1\n" +
|
36
|
+
" us-west-1-s3-url : s3://bp1-us-west-1/test1"
|
37
|
+
|
38
|
+
@formatter.detailed_format(:region => 'us-west-1',
|
39
|
+
:details => nil,
|
33
40
|
:name => 'test1').should == format
|
34
|
-
end
|
35
41
|
|
36
|
-
it "should return not found if name does not exist in catalog" do
|
37
|
-
format = "Heirloom not_here not found in catalog."
|
38
|
-
@formatter.format(:catalog => @catalog,
|
39
|
-
:name => 'not_here').should == format
|
40
42
|
end
|
41
43
|
end
|
42
44
|
|
data/spec/cli/list_spec.rb
CHANGED
@@ -8,25 +8,25 @@ describe Heirloom do
|
|
8
8
|
:level => 'info',
|
9
9
|
:metadata_region => 'us-west-1',
|
10
10
|
:count => 100 }
|
11
|
-
@
|
12
|
-
@
|
13
|
-
@
|
11
|
+
@logger_double = double :debug => true
|
12
|
+
@config_double = double_config :logger => @logger_double
|
13
|
+
@archive_double = double 'archive'
|
14
14
|
Heirloom::HeirloomLogger.should_receive(:new).with(:log_level => 'info').
|
15
|
-
and_return @
|
15
|
+
and_return @logger_double
|
16
16
|
Heirloom::CLI::List.any_instance.should_receive(:load_config).
|
17
|
-
with(:logger => @
|
17
|
+
with(:logger => @logger_double,
|
18
18
|
:opts => @options).
|
19
|
-
and_return @
|
19
|
+
and_return @config_double
|
20
20
|
Heirloom::Archive.should_receive(:new).
|
21
21
|
with(:name => 'archive_name',
|
22
|
-
:config => @
|
23
|
-
and_return @
|
22
|
+
:config => @config_double).
|
23
|
+
and_return @archive_double
|
24
24
|
Heirloom::Archive.should_receive(:new).
|
25
25
|
with(:name => 'archive_name',
|
26
|
-
:config => @
|
27
|
-
and_return @
|
28
|
-
@
|
29
|
-
@
|
26
|
+
:config => @config_double).
|
27
|
+
and_return @archive_double
|
28
|
+
@archive_double.should_receive(:domain_exists?).and_return true
|
29
|
+
@archive_double.should_receive(:count)
|
30
30
|
end
|
31
31
|
|
32
32
|
context "as json" do
|
@@ -37,7 +37,7 @@ describe Heirloom do
|
|
37
37
|
|
38
38
|
it "should list ids for given archive" do
|
39
39
|
@cli_list = Heirloom::CLI::List.new
|
40
|
-
@
|
40
|
+
@archive_double.should_receive(:list).with(100).and_return(['1','2'])
|
41
41
|
@cli_list.should_receive(:jj).with ['1','2']
|
42
42
|
@cli_list.list
|
43
43
|
end
|
@@ -51,7 +51,7 @@ describe Heirloom do
|
|
51
51
|
|
52
52
|
it "should list ids for given archive" do
|
53
53
|
@cli_list = Heirloom::CLI::List.new
|
54
|
-
@
|
54
|
+
@archive_double.should_receive(:list).with(100).and_return(['1','2'])
|
55
55
|
@cli_list.should_receive(:puts).with "1\n2"
|
56
56
|
@cli_list.list
|
57
57
|
end
|