knife-ec2 0.12.0 → 0.13.0

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.
@@ -1,75 +1,75 @@
1
- require File.expand_path('../../spec_helper', __FILE__)
2
- require 'fog'
3
-
4
- describe Chef::Knife::S3Source do
5
- before(:each) do
6
- @bucket_name = 'mybucket'
7
- @test_file_path = 'path/file.pem'
8
- @test_file_content = "TEST CONTENT\n"
9
-
10
- Fog.mock!
11
-
12
- {
13
- aws_access_key_id: 'aws_access_key_id',
14
- aws_secret_access_key: 'aws_secret_access_key'
15
- }.each do |key, value|
16
- Chef::Config[:knife][key] = value
17
- end
18
-
19
- fog = Fog::Storage::AWS.new(
20
- aws_access_key_id: 'aws_access_key_id',
21
- aws_secret_access_key: 'aws_secret_access_key'
22
- )
23
- test_dir_obj = fog.directories.create('key' => @bucket_name)
24
- test_file_obj = test_dir_obj.files.create('key' => @test_file_path)
25
- test_file_obj.body = @test_file_content
26
- test_file_obj.save
27
-
28
- @s3_connection = double(Fog::Storage::AWS)
29
- @s3_source = Chef::Knife::S3Source.new
30
- end
31
-
32
- context "for http URL format" do
33
- it 'converts URI to path with leading / removed' do
34
- @s3_source.url = "http://s3.amazonaws.com/#{@bucket_name}/#{@test_file_path}"
35
- @s3_source.instance_eval { path }
36
- expect(@s3_source.instance_eval { path }).to eq(@test_file_path)
37
- end
38
-
39
- it 'correctly retrieves the bucket name from the URI' do
40
- @s3_source.url = "http://s3.amazonaws.com/#{@bucket_name}/#{@test_file_path}"
41
- @s3_source.instance_eval { bucket }
42
- expect(@s3_source.instance_eval { bucket }).to eq(@bucket_name)
43
- end
44
-
45
- it 'gets back the correct bucket contents' do
46
- @s3_source.url = "http://s3.amazonaws.com/#{@bucket_name}/#{@test_file_path}"
47
- expect(@s3_source.body).to eq(@test_file_content)
48
- end
49
-
50
- it 'gets back a bucket object with bucket_obj' do
51
- @s3_source.url = "http://s3.amazonaws.com/#{@bucket_name}/#{@test_file_path}"
52
- @s3_source.instance_eval { bucket_obj }
53
- expect(@s3_source.instance_eval { bucket_obj }).to be_kind_of(Fog::Storage::AWS::Directory)
54
- end
55
- end
56
-
57
- context "for s3 URL format" do
58
- it 'correctly retrieves the bucket name from the URI' do
59
- @s3_source.url = "s3://#{@bucket_name}/#{@test_file_path}"
60
- @s3_source.instance_eval { bucket }
61
- expect(@s3_source.instance_eval { bucket }).to eq(@bucket_name)
62
- end
63
-
64
- it 'gets back the correct bucket contents' do
65
- @s3_source.url = "s3://#{@bucket_name}/#{@test_file_path}"
66
- expect(@s3_source.body).to eq(@test_file_content)
67
- end
68
-
69
- it 'gets back a bucket object with bucket_obj' do
70
- @s3_source.url = "s3://#{@bucket_name}/#{@test_file_path}"
71
- @s3_source.instance_eval { bucket_obj }
72
- expect(@s3_source.instance_eval { bucket_obj }).to be_kind_of(Fog::Storage::AWS::Directory)
73
- end
74
- end
75
- end
1
+ require File.expand_path('../../spec_helper', __FILE__)
2
+ require 'fog/aws'
3
+
4
+ describe Chef::Knife::S3Source do
5
+ before(:each) do
6
+ @bucket_name = 'mybucket'
7
+ @test_file_path = 'path/file.pem'
8
+ @test_file_content = "TEST CONTENT\n"
9
+
10
+ Fog.mock!
11
+
12
+ {
13
+ aws_access_key_id: 'aws_access_key_id',
14
+ aws_secret_access_key: 'aws_secret_access_key'
15
+ }.each do |key, value|
16
+ Chef::Config[:knife][key] = value
17
+ end
18
+
19
+ fog = Fog::Storage::AWS.new(
20
+ aws_access_key_id: 'aws_access_key_id',
21
+ aws_secret_access_key: 'aws_secret_access_key'
22
+ )
23
+ test_dir_obj = fog.directories.create('key' => @bucket_name)
24
+ test_file_obj = test_dir_obj.files.create('key' => @test_file_path)
25
+ test_file_obj.body = @test_file_content
26
+ test_file_obj.save
27
+
28
+ @s3_connection = double(Fog::Storage::AWS)
29
+ @s3_source = Chef::Knife::S3Source.new
30
+ end
31
+
32
+ context "for http URL format" do
33
+ it 'converts URI to path with leading / removed' do
34
+ @s3_source.url = "http://s3.amazonaws.com/#{@bucket_name}/#{@test_file_path}"
35
+ @s3_source.instance_eval { path }
36
+ expect(@s3_source.instance_eval { path }).to eq(@test_file_path)
37
+ end
38
+
39
+ it 'correctly retrieves the bucket name from the URI' do
40
+ @s3_source.url = "http://s3.amazonaws.com/#{@bucket_name}/#{@test_file_path}"
41
+ @s3_source.instance_eval { bucket }
42
+ expect(@s3_source.instance_eval { bucket }).to eq(@bucket_name)
43
+ end
44
+
45
+ it 'gets back the correct bucket contents' do
46
+ @s3_source.url = "http://s3.amazonaws.com/#{@bucket_name}/#{@test_file_path}"
47
+ expect(@s3_source.body).to eq(@test_file_content)
48
+ end
49
+
50
+ it 'gets back a bucket object with bucket_obj' do
51
+ @s3_source.url = "http://s3.amazonaws.com/#{@bucket_name}/#{@test_file_path}"
52
+ @s3_source.instance_eval { bucket_obj }
53
+ expect(@s3_source.instance_eval { bucket_obj }).to be_kind_of(Fog::Storage::AWS::Directory)
54
+ end
55
+ end
56
+
57
+ context "for s3 URL format" do
58
+ it 'correctly retrieves the bucket name from the URI' do
59
+ @s3_source.url = "s3://#{@bucket_name}/#{@test_file_path}"
60
+ @s3_source.instance_eval { bucket }
61
+ expect(@s3_source.instance_eval { bucket }).to eq(@bucket_name)
62
+ end
63
+
64
+ it 'gets back the correct bucket contents' do
65
+ @s3_source.url = "s3://#{@bucket_name}/#{@test_file_path}"
66
+ expect(@s3_source.body).to eq(@test_file_content)
67
+ end
68
+
69
+ it 'gets back a bucket object with bucket_obj' do
70
+ @s3_source.url = "s3://#{@bucket_name}/#{@test_file_path}"
71
+ @s3_source.instance_eval { bucket_obj }
72
+ expect(@s3_source.instance_eval { bucket_obj }).to be_kind_of(Fog::Storage::AWS::Directory)
73
+ end
74
+ end
75
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: knife-ec2
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.12.0
4
+ version: 0.13.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adam Jacob
@@ -9,22 +9,36 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-10-06 00:00:00.000000000 Z
12
+ date: 2016-08-08 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
- name: fog
15
+ name: fog-aws
16
16
  requirement: !ruby/object:Gem::Requirement
17
17
  requirements:
18
18
  - - "~>"
19
19
  - !ruby/object:Gem::Version
20
- version: 1.29.0
20
+ version: '0.7'
21
21
  type: :runtime
22
22
  prerelease: false
23
23
  version_requirements: !ruby/object:Gem::Requirement
24
24
  requirements:
25
25
  - - "~>"
26
26
  - !ruby/object:Gem::Version
27
- version: 1.29.0
27
+ version: '0.7'
28
+ - !ruby/object:Gem::Dependency
29
+ name: mime-types
30
+ requirement: !ruby/object:Gem::Requirement
31
+ requirements:
32
+ - - ">="
33
+ - !ruby/object:Gem::Version
34
+ version: '0'
35
+ type: :runtime
36
+ prerelease: false
37
+ version_requirements: !ruby/object:Gem::Requirement
38
+ requirements:
39
+ - - ">="
40
+ - !ruby/object:Gem::Version
41
+ version: '0'
28
42
  - !ruby/object:Gem::Dependency
29
43
  name: knife-windows
30
44
  requirement: !ruby/object:Gem::Requirement
@@ -103,8 +117,8 @@ dependencies:
103
117
  version: '0.3'
104
118
  description: EC2 Support for Chef's Knife Command
105
119
  email:
106
- - adam@opscode.com
107
- - schisamo@opscode.com
120
+ - adam@chef.io
121
+ - schisamo@chef.io
108
122
  executables: []
109
123
  extensions: []
110
124
  extra_rdoc_files: []
@@ -131,9 +145,10 @@ files:
131
145
  - spec/spec_helper.rb
132
146
  - spec/unit/ec2_server_create_spec.rb
133
147
  - spec/unit/ec2_server_delete_spec.rb
148
+ - spec/unit/ec2_server_list_spec.rb
134
149
  - spec/unit/s3_source_deps_spec.rb
135
150
  - spec/unit/s3_source_spec.rb
136
- homepage: https://github.com/opscode/knife-ec2
151
+ homepage: https://github.com/chef/knife-ec2
137
152
  licenses:
138
153
  - Apache-2.0
139
154
  metadata: {}
@@ -153,14 +168,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
153
168
  version: '0'
154
169
  requirements: []
155
170
  rubyforge_project:
156
- rubygems_version: 2.4.8
171
+ rubygems_version: 2.5.1
157
172
  signing_key:
158
173
  specification_version: 4
159
174
  summary: EC2 Support for Chef's Knife Command
160
- test_files:
161
- - spec/spec_helper.rb
162
- - spec/unit/ec2_server_create_spec.rb
163
- - spec/unit/ec2_server_delete_spec.rb
164
- - spec/unit/s3_source_deps_spec.rb
165
- - spec/unit/s3_source_spec.rb
175
+ test_files: []
166
176
  has_rdoc: