ridley 4.2.0 → 4.3.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.
Files changed (55) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +8 -0
  3. data/Gemfile +1 -1
  4. data/README.md +4 -4
  5. data/lib/ridley/connection.rb +1 -2
  6. data/lib/ridley/errors.rb +1 -0
  7. data/lib/ridley/mixin/params_validate.rb +4 -0
  8. data/lib/ridley/version.rb +1 -1
  9. data/ridley.gemspec +2 -2
  10. data/spec/acceptance/client_resource_spec.rb +12 -12
  11. data/spec/acceptance/cookbook_resource_spec.rb +15 -15
  12. data/spec/acceptance/data_bag_item_resource_spec.rb +14 -14
  13. data/spec/acceptance/data_bag_resource_spec.rb +4 -4
  14. data/spec/acceptance/environment_resource_spec.rb +14 -14
  15. data/spec/acceptance/node_resource_spec.rb +15 -15
  16. data/spec/acceptance/role_resource_spec.rb +14 -14
  17. data/spec/acceptance/sandbox_resource_spec.rb +3 -3
  18. data/spec/acceptance/search_resource_spec.rb +6 -6
  19. data/spec/acceptance/user_resource_spec.rb +21 -21
  20. data/spec/support/each_matcher.rb +2 -2
  21. data/spec/support/filepath_matchers.rb +2 -2
  22. data/spec/support/shared_examples/ridley_resource.rb +39 -39
  23. data/spec/unit/ridley/chef/cookbook/metadata_spec.rb +8 -8
  24. data/spec/unit/ridley/chef/cookbook/syntax_check_spec.rb +15 -15
  25. data/spec/unit/ridley/chef/cookbook_spec.rb +124 -118
  26. data/spec/unit/ridley/chef/digester_spec.rb +2 -2
  27. data/spec/unit/ridley/chef_object_spec.rb +35 -35
  28. data/spec/unit/ridley/chef_objects/client_object_spec.rb +2 -2
  29. data/spec/unit/ridley/chef_objects/cookbook_object_spec.rb +12 -12
  30. data/spec/unit/ridley/chef_objects/data_bag_item_object_spec.rb +7 -7
  31. data/spec/unit/ridley/chef_objects/data_bag_object_spec.rb +4 -1
  32. data/spec/unit/ridley/chef_objects/environment_object_spec.rb +10 -10
  33. data/spec/unit/ridley/chef_objects/node_object_spec.rb +28 -28
  34. data/spec/unit/ridley/chef_objects/role_object_spec.rb +10 -10
  35. data/spec/unit/ridley/chef_objects/sandbox_object_spec.rb +6 -6
  36. data/spec/unit/ridley/client_spec.rb +59 -21
  37. data/spec/unit/ridley/connection_spec.rb +7 -7
  38. data/spec/unit/ridley/errors_spec.rb +3 -3
  39. data/spec/unit/ridley/middleware/chef_auth_spec.rb +2 -2
  40. data/spec/unit/ridley/middleware/chef_response_spec.rb +29 -29
  41. data/spec/unit/ridley/middleware/parse_json_spec.rb +14 -14
  42. data/spec/unit/ridley/mixins/from_file_spec.rb +3 -3
  43. data/spec/unit/ridley/resource_spec.rb +5 -5
  44. data/spec/unit/ridley/resources/cookbook_resource_spec.rb +10 -10
  45. data/spec/unit/ridley/resources/data_bag_item_resource_spec.rb +1 -1
  46. data/spec/unit/ridley/resources/data_bag_resource_spec.rb +6 -3
  47. data/spec/unit/ridley/resources/environment_resource_spec.rb +4 -4
  48. data/spec/unit/ridley/resources/role_resource_spec.rb +1 -1
  49. data/spec/unit/ridley/resources/sandbox_resource_spec.rb +7 -7
  50. data/spec/unit/ridley/resources/search_resource_spec.rb +22 -22
  51. data/spec/unit/ridley/sandbox_uploader_spec.rb +3 -3
  52. data/spec/unit/ridley_spec.rb +6 -6
  53. metadata +15 -18
  54. data/lib/ridley/middleware/gzip.rb +0 -18
  55. data/spec/unit/ridley/middleware/gzip_spec.rb +0 -59
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c13d1d47eeb614454e357f42ed41e60d16fe1287
4
- data.tar.gz: 2e48d517a5fd6d1aa51327eb2c050207132b315e
3
+ metadata.gz: 1c7d2e45f884fb456322b48859368c420ec0f112
4
+ data.tar.gz: 0f0e0212abe893d298894fb71f7f2f385b9dd26f
5
5
  SHA512:
6
- metadata.gz: a7f9d49e3cff824cfdc0725ae925ffb205024474b037a44b3dcbcde037f63d8c6bd95cdc346191f10592a6d4ea72404c72aaea959d63566fa051e8e8d5ca0c98
7
- data.tar.gz: 0d0234d3ef23f7942e18c3c54c4c1f0528870259cf9fa89a5d5b5b3ce58d1f9faba59330394d1248335cba20f20adeb45d8e9c3805765a17b06d9abbc8f61e2b
6
+ metadata.gz: 0add3e0c899c30e52d0df48041940020c76508382ac622e3b21f8f9df39a59ccb25f5e6b1353e7ce648ba6b11ed34db644528ffad88fabbdabb909329363d066
7
+ data.tar.gz: 708ec93b537dd61a8443772c855345813af13de9418b9013928036efb35624465b8fd5938cc820ad3d6391ef7ebef1708294325d58e01500f2c5f9e92bac7607
@@ -1,3 +1,11 @@
1
+ # 4.3.0
2
+
3
+ * Enhancements
4
+ * Switch internal HTTP client from `net_http_persistent` to `httpclient`
5
+ * Loosen constraint on Hashie to allow for both the 2.x and 3.x line
6
+ * Bug Fixes
7
+ * Fix missiong constant ValidationFailed when performing a params validation
8
+
1
9
  # 4.2.0
2
10
 
3
11
  * Enhancements
data/Gemfile CHANGED
@@ -41,7 +41,7 @@ end
41
41
  group :test do
42
42
  gem 'thor'
43
43
  gem 'rake', '>= 0.9.2.2'
44
- gem 'rspec', '~> 2.14.0'
44
+ gem 'rspec', '~> 3.0'
45
45
  gem 'fuubar'
46
46
  gem 'json_spec'
47
47
  gem 'webmock'
data/README.md CHANGED
@@ -1,8 +1,8 @@
1
1
  # Ridley
2
2
  [![Gem Version](https://badge.fury.io/rb/ridley.png)](http://badge.fury.io/rb/ridley)
3
- [![Build Status](https://secure.travis-ci.org/RiotGames/ridley.png?branch=master)](http://travis-ci.org/RiotGames/ridley)
4
- [![Dependency Status](https://gemnasium.com/RiotGames/ridley.png?travis)](https://gemnasium.com/RiotGames/ridley)
5
- [![Code Climate](https://codeclimate.com/github/RiotGames/ridley.png)](https://codeclimate.com/github/RiotGames/ridley)
3
+ [![Build Status](https://secure.travis-ci.org/reset/ridley.png?branch=master)](http://travis-ci.org/reset/ridley)
4
+ [![Dependency Status](https://gemnasium.com/reset/ridley.png?travis)](https://gemnasium.com/reset/ridley)
5
+ [![Code Climate](https://codeclimate.com/github/reset/ridley.png)](https://codeclimate.com/github/reset/ridley)
6
6
 
7
7
  A reliable Chef API client with a clean syntax
8
8
 
@@ -430,4 +430,4 @@ Authors and Contributors
430
430
  - Jamie Winsor (<jamie@vialstudios.com>)
431
431
  - Kyle Allan (<kallan@riotgames.com>)
432
432
 
433
- Thank you to all of our [Contributors](https://github.com/RiotGames/ridley/graphs/contributors), testers, and users.
433
+ Thank you to all of our [Contributors](https://github.com/reset/ridley/graphs/contributors), testers, and users.
@@ -61,10 +61,9 @@ module Ridley
61
61
  b.request :chef_auth, client_name, client_key
62
62
 
63
63
  b.response :parse_json
64
- b.response :gzip
65
64
  b.response :chef_response
66
65
 
67
- b.adapter :net_http_persistent
66
+ b.adapter :httpclient
68
67
  end
69
68
 
70
69
  uri_hash = Ridley::Helpers.options_slice(Addressable::URI.parse(server_url).to_hash, :scheme, :host, :port)
@@ -10,6 +10,7 @@ module Ridley
10
10
 
11
11
  class ResourceNotFound < RidleyError; end
12
12
  class ValidatorNotFound < RidleyError; end
13
+ class ValidationFailed < RidleyError; end
13
14
 
14
15
  class InvalidResource < RidleyError
15
16
  attr_reader :errors
@@ -1,3 +1,5 @@
1
+ require 'ridley/errors'
2
+
1
3
  module Ridley::Mixin
2
4
  # Borrowed and modified from: {https://raw.github.com/opscode/chef/11.4.0/lib/chef/mixin/params_validate.rb}
3
5
  #
@@ -15,6 +17,8 @@ module Ridley::Mixin
15
17
  # See the License for the specific language governing permissions and
16
18
  # limitations under the License.
17
19
  module ParamsValidate
20
+ include Ridley::Errors
21
+
18
22
  # Takes a hash of options, along with a map to validate them. Returns the original
19
23
  # options hash, plus any changes that might have been made (through things like setting
20
24
  # default values in the validation map)
@@ -1,3 +1,3 @@
1
1
  module Ridley
2
- VERSION = "4.2.0"
2
+ VERSION = "4.3.0"
3
3
  end
@@ -27,10 +27,10 @@ Gem::Specification.new do |s|
27
27
  s.add_dependency 'celluloid-io', '~> 0.16.1'
28
28
  s.add_dependency 'erubis'
29
29
  s.add_dependency 'faraday', '~> 0.9.0'
30
- s.add_dependency 'hashie', '>= 2.0.2', '< 3.0.0'
30
+ s.add_dependency 'hashie', '>= 2.0.2', '< 4.0.0'
31
+ s.add_dependency 'httpclient', '~> 2.6'
31
32
  s.add_dependency 'json', '>= 1.7.7'
32
33
  s.add_dependency 'mixlib-authentication', '>= 1.3.0'
33
- s.add_dependency 'net-http-persistent', '>= 2.8'
34
34
  s.add_dependency 'retryable', '~> 2.0'
35
35
  s.add_dependency 'semverse', '~> 1.1'
36
36
 
@@ -11,30 +11,30 @@ describe "Client API operations", type: "acceptance" do
11
11
  before { chef_client("reset", admin: false) }
12
12
 
13
13
  it "returns a ClientObject" do
14
- connection.client.find("reset").should be_a(Ridley::ClientObject)
14
+ expect(connection.client.find("reset")).to be_a(Ridley::ClientObject)
15
15
  end
16
16
  end
17
17
 
18
18
  context "when the server does not have the client" do
19
19
  it "returns a nil value" do
20
- connection.client.find("not_there").should be_nil
20
+ expect(connection.client.find("not_there")).to be_nil
21
21
  end
22
22
  end
23
23
  end
24
24
 
25
25
  describe "creating a client" do
26
26
  it "returns a Ridley::ClientObject" do
27
- connection.client.create(name: "reset").should be_a(Ridley::ClientObject)
27
+ expect(connection.client.create(name: "reset")).to be_a(Ridley::ClientObject)
28
28
  end
29
29
 
30
30
  it "adds a client to the chef server" do
31
31
  old = connection.client.all.length
32
32
  connection.client.create(name: "reset")
33
- connection.client.all.should have(old + 1).items
33
+ expect(connection.client.all.size).to eq(old + 1)
34
34
  end
35
35
 
36
36
  it "has a value for #private_key" do
37
- connection.client.create(name: "reset").private_key.should_not be_nil
37
+ expect(connection.client.create(name: "reset").private_key).not_to be_nil
38
38
  end
39
39
  end
40
40
 
@@ -42,13 +42,13 @@ describe "Client API operations", type: "acceptance" do
42
42
  before { chef_client("reset", admin: false) }
43
43
 
44
44
  it "returns a Ridley::ClientObject object" do
45
- connection.client.delete("reset").should be_a(Ridley::ClientObject)
45
+ expect(connection.client.delete("reset")).to be_a(Ridley::ClientObject)
46
46
  end
47
47
 
48
48
  it "removes the client from the server" do
49
49
  connection.client.delete("reset")
50
50
 
51
- connection.client.find("reset").should be_nil
51
+ expect(connection.client.find("reset")).to be_nil
52
52
  end
53
53
  end
54
54
 
@@ -59,12 +59,12 @@ describe "Client API operations", type: "acceptance" do
59
59
  end
60
60
 
61
61
  it "returns an array of Ridley::ClientObject objects" do
62
- connection.client.delete_all.should each be_a(Ridley::ClientObject)
62
+ expect(connection.client.delete_all).to each be_a(Ridley::ClientObject)
63
63
  end
64
64
 
65
65
  it "deletes all clients from the remote" do
66
66
  connection.client.delete_all
67
- connection.client.all.should have(0).clients
67
+ expect(connection.client.all.size).to eq(0)
68
68
  end
69
69
  end
70
70
 
@@ -75,11 +75,11 @@ describe "Client API operations", type: "acceptance" do
75
75
  end
76
76
 
77
77
  it "returns an array of Ridley::ClientObject objects" do
78
- connection.client.all.should each be_a(Ridley::ClientObject)
78
+ expect(connection.client.all).to each be_a(Ridley::ClientObject)
79
79
  end
80
80
 
81
81
  it "returns all of the clients on the server" do
82
- connection.client.all.should have(4).items
82
+ expect(connection.client.all.size).to eq(4)
83
83
  end
84
84
  end
85
85
 
@@ -87,7 +87,7 @@ describe "Client API operations", type: "acceptance" do
87
87
  before { chef_client("reset", admin: false) }
88
88
 
89
89
  it "returns a Ridley::ClientObject object with a value for #private_key" do
90
- connection.client.regenerate_key("reset").private_key.should match(/^-----BEGIN RSA PRIVATE KEY-----/)
90
+ expect(connection.client.regenerate_key("reset").private_key).to match(/^-----BEGIN RSA PRIVATE KEY-----/)
91
91
  end
92
92
  end
93
93
  end
@@ -18,7 +18,7 @@ describe "Client API operations", type: "acceptance" do
18
18
  before { subject.download(name, version, destination) }
19
19
 
20
20
  it "downloads the cookbook to the destination" do
21
- expect(File.exist?(destination.join("metadata.json"))).to be_true
21
+ expect(File.exist?(destination.join("metadata.json"))).to be_truthy
22
22
  end
23
23
  end
24
24
  end
@@ -30,23 +30,23 @@ describe "Client API operations", type: "acceptance" do
30
30
  subject.upload(path)
31
31
  cookbook = subject.find("example_cookbook", "0.1.0")
32
32
 
33
- cookbook.attributes.should have(1).item
34
- cookbook.definitions.should have(1).item
35
- cookbook.files.should have(2).items
36
- cookbook.libraries.should have(1).item
37
- cookbook.providers.should have(1).item
38
- cookbook.recipes.should have(1).item
39
- cookbook.resources.should have(1).item
40
- cookbook.templates.should have(1).item
41
- cookbook.root_files.should have(1).items
33
+ expect(cookbook.attributes.size).to eq(1)
34
+ expect(cookbook.definitions.size).to eq(1)
35
+ expect(cookbook.files.size).to eq(2)
36
+ expect(cookbook.libraries.size).to eq(1)
37
+ expect(cookbook.providers.size).to eq(1)
38
+ expect(cookbook.recipes.size).to eq(1)
39
+ expect(cookbook.resources.size).to eq(1)
40
+ expect(cookbook.templates.size).to eq(1)
41
+ expect(cookbook.root_files.size).to eq(1)
42
42
  end
43
43
 
44
44
  it "does not contain a raw metadata.rb but does contain a compiled metadata.json" do
45
45
  subject.upload(path)
46
46
  cookbook = subject.find("example_cookbook", "0.1.0")
47
47
 
48
- expect(cookbook.root_files.any? { |f| f[:name] == "metadata.json" }).to be_true
49
- expect(cookbook.root_files.any? { |f| f[:name] == "metadata.rb" }).to be_false
48
+ expect(cookbook.root_files.any? { |f| f[:name] == "metadata.json" }).to be_truthy
49
+ expect(cookbook.root_files.any? { |f| f[:name] == "metadata.rb" }).to be_falsey
50
50
  end
51
51
  end
52
52
 
@@ -60,9 +60,9 @@ describe "Client API operations", type: "acceptance" do
60
60
 
61
61
  it "returns all of the cookbooks on the server" do
62
62
  all_cookbooks = subject.all
63
- expect(all_cookbooks).to have(2).items
64
- expect(all_cookbooks["ruby"]).to have(2).items
65
- expect(all_cookbooks["elixir"]).to have(2).items
63
+ expect(all_cookbooks.size).to eq(2)
64
+ expect(all_cookbooks["ruby"].size).to eq(2)
65
+ expect(all_cookbooks["elixir"].size).to eq(2)
66
66
  end
67
67
  end
68
68
  end
@@ -14,7 +14,7 @@ describe "DataBag API operations", type: "acceptance" do
14
14
  describe "listing data bag items" do
15
15
  context "when the data bag has no items" do
16
16
  it "returns an empty array" do
17
- data_bag.item.all.should have(0).items
17
+ expect(data_bag.item.all.size).to eq(0)
18
18
  end
19
19
  end
20
20
 
@@ -25,7 +25,7 @@ describe "DataBag API operations", type: "acceptance" do
25
25
  end
26
26
 
27
27
  it "returns an array with each item" do
28
- data_bag.item.all.should have(2).items
28
+ expect(data_bag.item.all.size).to eq(2)
29
29
  end
30
30
  end
31
31
  end
@@ -34,7 +34,7 @@ describe "DataBag API operations", type: "acceptance" do
34
34
  it "adds a data bag item to the collection of data bag items" do
35
35
  data_bag.item.create(id: "appconfig", host: "host.local", port: 80, admin: false, servers: ["one"])
36
36
 
37
- data_bag.item.all.should have(1).item
37
+ expect(data_bag.item.all.size).to eq(1)
38
38
  end
39
39
 
40
40
  context "when an 'id' field is missing" do
@@ -59,7 +59,7 @@ describe "DataBag API operations", type: "acceptance" do
59
59
  }
60
60
  data_bag.item.create(attributes)
61
61
 
62
- data_bag.item.find("appconfig").to_hash.should eql(attributes)
62
+ expect(data_bag.item.find("appconfig").to_hash).to eql(attributes)
63
63
  end
64
64
  end
65
65
 
@@ -76,14 +76,14 @@ describe "DataBag API operations", type: "acceptance" do
76
76
  it "returns the deleted data bag item" do
77
77
  dbi = data_bag.item.delete(attributes["id"])
78
78
 
79
- dbi.should be_a(Ridley::DataBagItemObject)
80
- dbi.attributes.should eql(attributes)
79
+ expect(dbi).to be_a(Ridley::DataBagItemObject)
80
+ expect(dbi.attributes).to eql(attributes)
81
81
  end
82
82
 
83
83
  it "deletes the data bag item from the server" do
84
84
  data_bag.item.delete(attributes["id"])
85
85
 
86
- data_bag.item.find(attributes["id"]).should be_nil
86
+ expect(data_bag.item.find(attributes["id"])).to be_nil
87
87
  end
88
88
  end
89
89
 
@@ -94,13 +94,13 @@ describe "DataBag API operations", type: "acceptance" do
94
94
  end
95
95
 
96
96
  it "returns the array of deleted data bag items" do
97
- data_bag.item.delete_all.should each be_a(Ridley::DataBagItemObject)
97
+ expect(data_bag.item.delete_all).to each be_a(Ridley::DataBagItemObject)
98
98
  end
99
99
 
100
100
  it "removes all data bag items from the data bag" do
101
101
  data_bag.item.delete_all
102
102
 
103
- data_bag.item.all.should have(0).items
103
+ expect(data_bag.item.all.size).to eq(0)
104
104
  end
105
105
  end
106
106
 
@@ -110,7 +110,7 @@ describe "DataBag API operations", type: "acceptance" do
110
110
  it "returns the updated data bag item" do
111
111
  dbi = data_bag.item.update(id: "one", name: "brooke")
112
112
 
113
- dbi[:name].should eql("brooke")
113
+ expect(dbi[:name]).to eql("brooke")
114
114
  end
115
115
  end
116
116
 
@@ -120,14 +120,14 @@ describe "DataBag API operations", type: "acceptance" do
120
120
 
121
121
  it "returns true if successful" do
122
122
  dbi[:name] = "brooke"
123
- dbi.save.should be_true
123
+ expect(dbi.save).to be_truthy
124
124
  end
125
125
 
126
126
  it "creates a new data bag item on the remote" do
127
127
  dbi[:name] = "brooke"
128
128
  dbi.save
129
129
 
130
- data_bag.item.all.should have(1).item
130
+ expect(data_bag.item.all.size).to eq(1)
131
131
  end
132
132
  end
133
133
 
@@ -136,7 +136,7 @@ describe "DataBag API operations", type: "acceptance" do
136
136
  dbi = data_bag.item.new
137
137
 
138
138
  dbi.attributes = { id: "not-there", name: "brooke" }
139
- dbi.save.should be_true
139
+ expect(dbi.save).to be_truthy
140
140
  end
141
141
 
142
142
  it "creates a new data bag item on the remote" do
@@ -144,7 +144,7 @@ describe "DataBag API operations", type: "acceptance" do
144
144
  dbi.attributes = { id: "not-there", name: "brooke" }
145
145
  dbi.save
146
146
 
147
- data_bag.item.all.should have(1).item
147
+ expect(data_bag.item.all.size).to eq(1)
148
148
  end
149
149
  end
150
150
  end
@@ -9,7 +9,7 @@ describe "DataBag API operations", type: "acceptance" do
9
9
  describe "listing data bags" do
10
10
  context "when no data bags exist" do
11
11
  it "returns an empty array" do
12
- connection.data_bag.all.should have(0).items
12
+ expect(connection.data_bag.all.size).to eq(0)
13
13
  end
14
14
  end
15
15
 
@@ -20,18 +20,18 @@ describe "DataBag API operations", type: "acceptance" do
20
20
  end
21
21
 
22
22
  it "returns an array of data bags" do
23
- connection.data_bag.all.should each be_a(Ridley::DataBagObject)
23
+ expect(connection.data_bag.all).to each be_a(Ridley::DataBagObject)
24
24
  end
25
25
 
26
26
  it "returns all of the data bags on the server" do
27
- connection.data_bag.all.should have(2).items
27
+ expect(connection.data_bag.all.size).to eq(2)
28
28
  end
29
29
  end
30
30
  end
31
31
 
32
32
  describe "creating a data bag" do
33
33
  it "returns a Ridley::DataBagObject" do
34
- connection.data_bag.create(name: "ridley-one").should be_a(Ridley::DataBagObject)
34
+ expect(connection.data_bag.create(name: "ridley-one")).to be_a(Ridley::DataBagObject)
35
35
  end
36
36
  end
37
37
  end
@@ -10,7 +10,7 @@ describe "Environment API operations", type: "acceptance" do
10
10
  before { chef_environment("ridley-test-env") }
11
11
 
12
12
  it "returns a valid Ridley::EnvironmentObject object" do
13
- connection.environment.find("ridley-test-env").should be_a(Ridley::EnvironmentObject)
13
+ expect(connection.environment.find("ridley-test-env")).to be_a(Ridley::EnvironmentObject)
14
14
  end
15
15
  end
16
16
 
@@ -18,13 +18,13 @@ describe "Environment API operations", type: "acceptance" do
18
18
  it "returns a valid Ridley::EnvironmentObject object" do
19
19
  obj = connection.environment.create(name: "ridley-test-env", description: "a testing env for ridley")
20
20
 
21
- obj.should be_a(Ridley::EnvironmentObject)
21
+ expect(obj).to be_a(Ridley::EnvironmentObject)
22
22
  end
23
23
 
24
24
  it "adds an environment to the chef server" do
25
25
  old = connection.environment.all.length
26
26
  connection.environment.create(name: "ridley")
27
- connection.environment.all.should have(old + 1).item
27
+ expect(connection.environment.all.size).to eq(old + 1)
28
28
  end
29
29
  end
30
30
 
@@ -32,19 +32,19 @@ describe "Environment API operations", type: "acceptance" do
32
32
  before { chef_environment("ridley-env") }
33
33
 
34
34
  it "returns a Ridley::EnvironmentObject object" do
35
- connection.environment.delete("ridley-env").should be_a(Ridley::EnvironmentObject)
35
+ expect(connection.environment.delete("ridley-env")).to be_a(Ridley::EnvironmentObject)
36
36
  end
37
37
 
38
38
  it "removes the environment from the server" do
39
39
  connection.environment.delete("ridley-env")
40
40
 
41
- connection.environment.find("ridley-env").should be_nil
41
+ expect(connection.environment.find("ridley-env")).to be_nil
42
42
  end
43
43
 
44
44
  it "raises Ridley::Errors::HTTPMethodNotAllowed when attempting to delete the '_default' environment" do
45
- lambda {
45
+ expect {
46
46
  connection.environment.delete("_default")
47
- }.should raise_error(Ridley::Errors::HTTPMethodNotAllowed)
47
+ }.to raise_error(Ridley::Errors::HTTPMethodNotAllowed)
48
48
  end
49
49
  end
50
50
 
@@ -55,19 +55,19 @@ describe "Environment API operations", type: "acceptance" do
55
55
  end
56
56
 
57
57
  it "returns an array of Ridley::EnvironmentObject objects" do
58
- connection.environment.delete_all.should each be_a(Ridley::EnvironmentObject)
58
+ expect(connection.environment.delete_all).to each be_a(Ridley::EnvironmentObject)
59
59
  end
60
60
 
61
61
  it "deletes all environments but '_default' from the remote" do
62
62
  connection.environment.delete_all
63
63
 
64
- connection.environment.all.should have(1).item
64
+ expect(connection.environment.all.size).to eq(1)
65
65
  end
66
66
  end
67
67
 
68
68
  describe "listing all environments" do
69
69
  it "should return an array of Ridley::EnvironmentObject objects" do
70
- connection.environment.all.should each be_a(Ridley::EnvironmentObject)
70
+ expect(connection.environment.all).to each be_a(Ridley::EnvironmentObject)
71
71
  end
72
72
  end
73
73
 
@@ -79,7 +79,7 @@ describe "Environment API operations", type: "acceptance" do
79
79
  target.description = description = "ridley testing environment"
80
80
 
81
81
  connection.environment.update(target)
82
- target.reload.description.should eql(description)
82
+ expect(target.reload.description).to eql(description)
83
83
  end
84
84
 
85
85
  it "saves a new set of 'default_attributes'" do
@@ -92,7 +92,7 @@ describe "Environment API operations", type: "acceptance" do
92
92
 
93
93
  connection.environment.update(target)
94
94
  obj = connection.environment.find(target)
95
- obj.default_attributes.should eql(default_attributes)
95
+ expect(obj.default_attributes).to eql(default_attributes)
96
96
  end
97
97
 
98
98
  it "saves a new set of 'override_attributes'" do
@@ -105,7 +105,7 @@ describe "Environment API operations", type: "acceptance" do
105
105
 
106
106
  connection.environment.update(target)
107
107
  obj = connection.environment.find(target)
108
- obj.override_attributes.should eql(override_attributes)
108
+ expect(obj.override_attributes).to eql(override_attributes)
109
109
  end
110
110
 
111
111
  it "saves a new set of 'cookbook_versions'" do
@@ -116,7 +116,7 @@ describe "Environment API operations", type: "acceptance" do
116
116
 
117
117
  connection.environment.update(target)
118
118
  obj = connection.environment.find(target)
119
- obj.cookbook_versions.should eql(cookbook_versions)
119
+ expect(obj.cookbook_versions).to eql(cookbook_versions)
120
120
  end
121
121
  end
122
122
  end