dpl 1.8.32.travis.1957.5 → 1.8.32.travis.1958.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/dpl/provider/elastic_beanstalk.rb +1 -1
- data/spec/provider/elastic_beanstalk_spec.rb +42 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5c73cb5cb409a1dcc6e94c211efcfcc4b701b7da
|
4
|
+
data.tar.gz: 754816797de947073773b8c6b352da140039dc75
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fa61f15d0ee4343f10a2ee10ec2960d4b1cfe3fe567f5da9ff6208636b04c99be0c38ad8632c766914a8c22e944c2bbcbb98cea547b852bb15267c130efaf41c
|
7
|
+
data.tar.gz: 4fe17be5fd9042da66cd70e6970b9f7671e5f7680baf993000274261237283fa0bedeacb364c91bea6ebcd41176d4d507d5c3c51de3c75f3d5e87fac04077422
|
@@ -65,7 +65,7 @@ describe DPL::Provider::ElasticBeanstalk do
|
|
65
65
|
allow(io_double).to receive(:open)
|
66
66
|
allow(s3_obj_double).to receive(:put).with(anything).and_return(Object.new)
|
67
67
|
allow(s3_mock).to receive(:bucket).with(bucket_name).and_return(bucket_mock)
|
68
|
-
expect(Pathname).to receive(:new).
|
68
|
+
expect(Pathname).to receive(:new).and_return(io_double)
|
69
69
|
end
|
70
70
|
|
71
71
|
example 'bucket exists already' do
|
@@ -158,5 +158,46 @@ describe DPL::Provider::ElasticBeanstalk do
|
|
158
158
|
provider.push_app
|
159
159
|
end
|
160
160
|
end
|
161
|
+
|
162
|
+
context "when zip_file option is given" do
|
163
|
+
before :each do
|
164
|
+
allow(bucket_mock).to receive(:object).with("some/app/file.zip").and_return(s3_obj_double)
|
165
|
+
expect(provider).to receive(:s3).and_return(s3_mock).twice
|
166
|
+
expect(provider).to receive(:create_bucket)
|
167
|
+
expect(provider).to receive(:archive_name).and_return('file.zip')
|
168
|
+
expect(provider).to receive(:sleep).with(5)
|
169
|
+
expect(provider).to receive(:create_app_version).with(s3_obj_double).and_return(app_version)
|
170
|
+
expect(provider).to receive(:update_app).with(app_version)
|
171
|
+
end
|
172
|
+
|
173
|
+
example 'zip_file is an absolute path' do
|
174
|
+
provider.options.update(:zip_file => '/absolute/path/to/file.zip')
|
175
|
+
expect(provider).to receive(:upload).with('file.zip', '/absolute/path/to/file.zip').and_call_original
|
176
|
+
|
177
|
+
provider.push_app
|
178
|
+
end
|
179
|
+
|
180
|
+
example 'zip_file is an relative path' do
|
181
|
+
provider.options.update(:zip_file => 'relative/path/to/file.zip')
|
182
|
+
expect(provider).to receive(:upload).with('file.zip', File.join(Dir.pwd, 'relative/path/to/file.zip')).and_call_original
|
183
|
+
|
184
|
+
provider.push_app
|
185
|
+
end
|
186
|
+
|
187
|
+
example 'zip_file is a path with ~/' do
|
188
|
+
provider.options.update(:zip_file => '~/file.zip')
|
189
|
+
expect(provider).to receive(:upload).with('file.zip', File.join(ENV['HOME'], 'file.zip')).and_call_original
|
190
|
+
|
191
|
+
provider.push_app
|
192
|
+
end
|
193
|
+
|
194
|
+
example 'zip_file is has no path' do
|
195
|
+
provider.options.update(:zip_file => 'file.zip')
|
196
|
+
expect(provider).to receive(:upload).with('file.zip', File.join(Dir.pwd, 'file.zip')).and_call_original
|
197
|
+
|
198
|
+
provider.push_app
|
199
|
+
end
|
200
|
+
|
201
|
+
end
|
161
202
|
end
|
162
203
|
end
|