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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3e39224780b902e25e44ae745cfa501ed7f926b4
4
- data.tar.gz: 699230260516ed63565df9b747c03d51d934eeb9
3
+ metadata.gz: 5c73cb5cb409a1dcc6e94c211efcfcc4b701b7da
4
+ data.tar.gz: 754816797de947073773b8c6b352da140039dc75
5
5
  SHA512:
6
- metadata.gz: 6f5ab1930859cca43e325bfdfe66608b559162f7d66e1ec584be7dbacedb08488e5976e688e53001925e8465a1bf3a1c5e5d8f346983bd247b805b250d683e05
7
- data.tar.gz: 99a848b888c4120e3bc695468b6860496274faaa90b4639404651ac24d7eb9bce4b6fca6f18066fc32784521ed3db86573a07e9c0c93534dbec0a9504d81b6d7
6
+ metadata.gz: fa61f15d0ee4343f10a2ee10ec2960d4b1cfe3fe567f5da9ff6208636b04c99be0c38ad8632c766914a8c22e944c2bbcbb98cea547b852bb15267c130efaf41c
7
+ data.tar.gz: 4fe17be5fd9042da66cd70e6970b9f7671e5f7680baf993000274261237283fa0bedeacb364c91bea6ebcd41176d4d507d5c3c51de3c75f3d5e87fac04077422
@@ -42,7 +42,7 @@ module DPL
42
42
  create_bucket unless bucket_exists?
43
43
 
44
44
  if options[:zip_file]
45
- zip_file = File.join(Dir.pwd, options[:zip_file])
45
+ zip_file = File.expand_path(options[:zip_file])
46
46
  else
47
47
  zip_file = create_zip
48
48
  end
@@ -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).with('/path/to/file.zip').and_return(io_double)
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dpl
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.8.32.travis.1957.5
4
+ version: 1.8.32.travis.1958.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Konstantin Haase