2
2
3
3
module Tina
4
4
describe RestorePlan do
5
- subject do
6
- described_class . new ( total_storage_size , object_collection , options )
7
- end
8
-
9
5
let :total_storage_size do
10
6
75 * ( 1024 ** 4 )
11
7
end
@@ -29,15 +25,15 @@ module Tina
29
25
# http://aws.amazon.com/glacier/faqs/
30
26
context 'with the examples given on the Amazon Glacier pricing FAQ' do
31
27
it 'matches the the price for a restore with everything at once' do
32
- expect ( subject . price ( 4 * 3600 ) ) . to be_within ( 0.05 ) . of ( 21.6 )
28
+ expect ( described_class . new ( total_storage_size , object_collection , 4 * 3600 , options ) . price ) . to be_within ( 0.05 ) . of ( 21.6 )
33
29
end
34
30
35
31
it 'matches the the price for a restore over 8 hours' do
36
- expect ( subject . price ( 8 * 3600 ) ) . to be_within ( 0.05 ) . of ( 10.8 )
32
+ expect ( described_class . new ( total_storage_size , object_collection , 8 * 3600 , options ) . price ) . to be_within ( 0.05 ) . of ( 10.8 )
37
33
end
38
34
39
35
it 'matches the the price for a restore over 28 hours' do
40
- expect ( subject . price ( 28 * 3600 ) ) . to eq 0
36
+ expect ( described_class . new ( total_storage_size , object_collection , 28 * 3600 , options ) . price ) . to eq 0
41
37
end
42
38
end
43
39
@@ -58,19 +54,19 @@ module Tina
58
54
end
59
55
60
56
it 'matches the price for a restore over a month' do
61
- expect ( subject . price ( 30 * 24 * 3600 ) ) . to be_within ( 0.05 ) . of ( 4.16 )
57
+ expect ( described_class . new ( total_storage_size , object_collection , 30 * 24 * 3600 , options ) . price ) . to be_within ( 0.05 ) . of ( 4.16 )
62
58
end
63
59
64
60
it 'matches the price for a restore over a week' do
65
- expect ( subject . price ( 7 * 24 * 3600 ) ) . to be_within ( 0.05 ) . of ( 437.87 )
61
+ expect ( described_class . new ( total_storage_size , object_collection , 7 * 24 * 3600 , options ) . price ) . to be_within ( 0.05 ) . of ( 437.87 )
66
62
end
67
63
68
64
it 'matches the price for a restore over a day' do
69
- expect ( subject . price ( 1 * 24 * 3600 ) ) . to be_within ( 0.05 ) . of ( 3832.16 )
65
+ expect ( described_class . new ( total_storage_size , object_collection , 1 * 24 * 3600 , options ) . price ) . to be_within ( 0.05 ) . of ( 3832.16 )
70
66
end
71
67
72
68
it 'matches the price for a restore over a 4 hour period' do
73
- expect ( subject . price ( 4 * 3600 ) ) . to be_within ( 0.05 ) . of ( 22992.93 )
69
+ expect ( described_class . new ( total_storage_size , object_collection , 4 * 3600 , options ) . price ) . to be_within ( 0.05 ) . of ( 22992.93 )
74
70
end
75
71
end
76
72
@@ -84,7 +80,7 @@ module Tina
84
80
end
85
81
86
82
it 'matches the price for a restore over 4 days' do
87
- expect ( subject . price ( 4 * 24 * 3600 ) ) . to be_within ( 20 ) . of ( 768 )
83
+ expect ( described_class . new ( total_storage_size , object_collection , 4 * 24 * 3600 , options ) . price ) . to be_within ( 20 ) . of ( 768 )
88
84
end
89
85
end
90
86
end
0 commit comments