ridley 4.0.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 (65) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +31 -0
  3. data/Gemfile +1 -1
  4. data/README.md +4 -4
  5. data/Rakefile +1 -0
  6. data/lib/ridley/chef/config.rb +5 -5
  7. data/lib/ridley/chef/cookbook/metadata.rb +59 -14
  8. data/lib/ridley/chef/cookbook/syntax_check.rb +57 -19
  9. data/lib/ridley/chef/cookbook.rb +1 -1
  10. data/lib/ridley/chef/digester.rb +3 -1
  11. data/lib/ridley/client.rb +6 -3
  12. data/lib/ridley/connection.rb +5 -4
  13. data/lib/ridley/errors.rb +1 -0
  14. data/lib/ridley/helpers.rb +10 -0
  15. data/lib/ridley/mixin/params_validate.rb +4 -0
  16. data/lib/ridley/resources/cookbook_resource.rb +14 -2
  17. data/lib/ridley/version.rb +1 -1
  18. data/ridley.gemspec +5 -5
  19. data/spec/acceptance/client_resource_spec.rb +12 -12
  20. data/spec/acceptance/cookbook_resource_spec.rb +15 -15
  21. data/spec/acceptance/data_bag_item_resource_spec.rb +14 -14
  22. data/spec/acceptance/data_bag_resource_spec.rb +4 -4
  23. data/spec/acceptance/environment_resource_spec.rb +14 -14
  24. data/spec/acceptance/node_resource_spec.rb +15 -15
  25. data/spec/acceptance/role_resource_spec.rb +14 -14
  26. data/spec/acceptance/sandbox_resource_spec.rb +3 -3
  27. data/spec/acceptance/search_resource_spec.rb +6 -6
  28. data/spec/acceptance/user_resource_spec.rb +21 -21
  29. data/spec/support/each_matcher.rb +2 -2
  30. data/spec/support/filepath_matchers.rb +2 -2
  31. data/spec/support/shared_examples/ridley_resource.rb +39 -39
  32. data/spec/unit/ridley/chef/cookbook/metadata_spec.rb +8 -8
  33. data/spec/unit/ridley/chef/cookbook/syntax_check_spec.rb +15 -15
  34. data/spec/unit/ridley/chef/cookbook_spec.rb +159 -114
  35. data/spec/unit/ridley/chef/digester_spec.rb +2 -2
  36. data/spec/unit/ridley/chef_object_spec.rb +35 -35
  37. data/spec/unit/ridley/chef_objects/client_object_spec.rb +2 -2
  38. data/spec/unit/ridley/chef_objects/cookbook_object_spec.rb +12 -12
  39. data/spec/unit/ridley/chef_objects/data_bag_item_object_spec.rb +7 -7
  40. data/spec/unit/ridley/chef_objects/data_bag_object_spec.rb +4 -1
  41. data/spec/unit/ridley/chef_objects/environment_object_spec.rb +10 -10
  42. data/spec/unit/ridley/chef_objects/node_object_spec.rb +28 -28
  43. data/spec/unit/ridley/chef_objects/role_object_spec.rb +10 -10
  44. data/spec/unit/ridley/chef_objects/sandbox_object_spec.rb +6 -6
  45. data/spec/unit/ridley/client_spec.rb +59 -21
  46. data/spec/unit/ridley/connection_spec.rb +7 -7
  47. data/spec/unit/ridley/errors_spec.rb +3 -3
  48. data/spec/unit/ridley/middleware/chef_auth_spec.rb +2 -2
  49. data/spec/unit/ridley/middleware/chef_response_spec.rb +29 -29
  50. data/spec/unit/ridley/middleware/parse_json_spec.rb +14 -14
  51. data/spec/unit/ridley/mixins/from_file_spec.rb +3 -3
  52. data/spec/unit/ridley/resource_spec.rb +5 -5
  53. data/spec/unit/ridley/resources/cookbook_resource_spec.rb +21 -21
  54. data/spec/unit/ridley/resources/data_bag_item_resource_spec.rb +1 -1
  55. data/spec/unit/ridley/resources/data_bag_resource_spec.rb +6 -3
  56. data/spec/unit/ridley/resources/environment_resource_spec.rb +4 -4
  57. data/spec/unit/ridley/resources/role_resource_spec.rb +1 -1
  58. data/spec/unit/ridley/resources/sandbox_resource_spec.rb +7 -7
  59. data/spec/unit/ridley/resources/search_resource_spec.rb +22 -22
  60. data/spec/unit/ridley/sandbox_uploader_spec.rb +3 -3
  61. data/spec/unit/ridley_spec.rb +6 -6
  62. metadata +62 -64
  63. data/.ruby-version +0 -1
  64. data/lib/ridley/middleware/gzip.rb +0 -18
  65. data/spec/unit/ridley/middleware/gzip_spec.rb +0 -59
@@ -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
@@ -11,7 +11,7 @@ describe "Node API operations", type: "acceptance" do
11
11
  before { chef_node(node_name) }
12
12
 
13
13
  it "returns a Ridley::NodeObject" do
14
- connection.node.find(node_name).should be_a(Ridley::NodeObject)
14
+ expect(connection.node.find(node_name)).to be_a(Ridley::NodeObject)
15
15
  end
16
16
  end
17
17
 
@@ -19,13 +19,13 @@ describe "Node API operations", type: "acceptance" do
19
19
  let(:node_name) { "ridley.localhost" }
20
20
 
21
21
  it "returns a new Ridley::NodeObject object" do
22
- connection.node.create(name: node_name).should be_a(Ridley::NodeObject)
22
+ expect(connection.node.create(name: node_name)).to be_a(Ridley::NodeObject)
23
23
  end
24
24
 
25
25
  it "adds a new node to the server" do
26
26
  connection.node.create(name: node_name)
27
27
 
28
- connection.node.all.should have(1).node
28
+ expect(connection.node.all.size).to eq(1)
29
29
  end
30
30
  end
31
31
 
@@ -34,13 +34,13 @@ describe "Node API operations", type: "acceptance" do
34
34
  before { chef_node(node_name) }
35
35
 
36
36
  it "returns a Ridley::NodeObject" do
37
- connection.node.delete(node_name).should be_a(Ridley::NodeObject)
37
+ expect(connection.node.delete(node_name)).to be_a(Ridley::NodeObject)
38
38
  end
39
39
 
40
40
  it "removes the node from the server" do
41
41
  connection.node.delete(node_name)
42
42
 
43
- connection.node.find(node_name).should be_nil
43
+ expect(connection.node.find(node_name)).to be_nil
44
44
  end
45
45
  end
46
46
 
@@ -53,7 +53,7 @@ describe "Node API operations", type: "acceptance" do
53
53
  it "deletes all nodes from the remote server" do
54
54
  connection.node.delete_all
55
55
 
56
- connection.node.all.should have(0).nodes
56
+ expect(connection.node.all.size).to eq(0)
57
57
  end
58
58
  end
59
59
 
@@ -66,8 +66,8 @@ describe "Node API operations", type: "acceptance" do
66
66
  it "returns an array of Ridley::NodeObject" do
67
67
  obj = connection.node.all
68
68
 
69
- obj.should each be_a(Ridley::NodeObject)
70
- obj.should have(2).nodes
69
+ expect(obj).to each be_a(Ridley::NodeObject)
70
+ expect(obj.size).to eq(2)
71
71
  end
72
72
  end
73
73
 
@@ -77,7 +77,7 @@ describe "Node API operations", type: "acceptance" do
77
77
  let(:target) { connection.node.find(node_name) }
78
78
 
79
79
  it "returns the updated node" do
80
- connection.node.update(target).should eql(target)
80
+ expect(connection.node.update(target)).to eql(target)
81
81
  end
82
82
 
83
83
  it "saves a new set of 'normal' attributes" do
@@ -91,7 +91,7 @@ describe "Node API operations", type: "acceptance" do
91
91
  connection.node.update(target)
92
92
  obj = connection.node.find(target)
93
93
 
94
- obj.normal.should eql(normal)
94
+ expect(obj.normal).to eql(normal)
95
95
  end
96
96
 
97
97
  it "saves a new set of 'default' attributes" do
@@ -105,7 +105,7 @@ describe "Node API operations", type: "acceptance" do
105
105
  connection.node.update(target)
106
106
  obj = connection.node.find(target)
107
107
 
108
- obj.default.should eql(defaults)
108
+ expect(obj.default).to eql(defaults)
109
109
  end
110
110
 
111
111
  it "saves a new set of 'automatic' attributes" do
@@ -119,7 +119,7 @@ describe "Node API operations", type: "acceptance" do
119
119
  connection.node.update(target)
120
120
  obj = connection.node.find(target)
121
121
 
122
- obj.automatic.should eql(automatics)
122
+ expect(obj.automatic).to eql(automatics)
123
123
  end
124
124
 
125
125
  it "saves a new set of 'override' attributes" do
@@ -133,7 +133,7 @@ describe "Node API operations", type: "acceptance" do
133
133
  connection.node.update(target)
134
134
  obj = connection.node.find(target)
135
135
 
136
- obj.override.should eql(overrides)
136
+ expect(obj.override).to eql(overrides)
137
137
  end
138
138
 
139
139
  it "places a node in a new 'chef_environment'" do
@@ -142,7 +142,7 @@ describe "Node API operations", type: "acceptance" do
142
142
  connection.node.update(target)
143
143
  obj = connection.node.find(target)
144
144
 
145
- obj.chef_environment.should eql(environment)
145
+ expect(obj.chef_environment).to eql(environment)
146
146
  end
147
147
 
148
148
  it "saves a new 'run_list' for the node" do
@@ -151,7 +151,7 @@ describe "Node API operations", type: "acceptance" do
151
151
  connection.node.update(target)
152
152
  obj = connection.node.find(target)
153
153
 
154
- obj.run_list.should eql(run_list)
154
+ expect(obj.run_list).to eql(run_list)
155
155
  end
156
156
  end
157
157
  end
@@ -11,7 +11,7 @@ describe "Role API operations", type: "acceptance" do
11
11
  before { chef_role(role_name) }
12
12
 
13
13
  it "returns a Ridley::RoleObject" do
14
- connection.role.find(role_name).should be_a(Ridley::RoleObject)
14
+ expect(connection.role.find(role_name)).to be_a(Ridley::RoleObject)
15
15
  end
16
16
  end
17
17
 
@@ -19,12 +19,12 @@ describe "Role API operations", type: "acceptance" do
19
19
  let(:role_name) { "ridley-role" }
20
20
 
21
21
  it "returns a new Ridley::RoleObject" do
22
- connection.role.create(name: role_name).should be_a(Ridley::RoleObject)
22
+ expect(connection.role.create(name: role_name)).to be_a(Ridley::RoleObject)
23
23
  end
24
24
 
25
25
  it "adds a new role to the server" do
26
26
  connection.role.create(name: role_name)
27
- connection.role.all.should have(1).role
27
+ expect(connection.role.all.size).to eq(1)
28
28
  end
29
29
  end
30
30
 
@@ -33,13 +33,13 @@ describe "Role API operations", type: "acceptance" do
33
33
  before { chef_role(role_name) }
34
34
 
35
35
  it "returns the deleted Ridley::RoleObject resource" do
36
- connection.role.delete(role_name).should be_a(Ridley::RoleObject)
36
+ expect(connection.role.delete(role_name)).to be_a(Ridley::RoleObject)
37
37
  end
38
38
 
39
39
  it "removes the role from the server" do
40
40
  connection.role.delete(role_name)
41
41
 
42
- connection.role.find(role_name).should be_nil
42
+ expect(connection.role.find(role_name)).to be_nil
43
43
  end
44
44
  end
45
45
 
@@ -52,7 +52,7 @@ describe "Role API operations", type: "acceptance" do
52
52
  it "deletes all nodes from the remote server" do
53
53
  connection.role.delete_all
54
54
 
55
- connection.role.all.should have(0).roles
55
+ expect(connection.role.all.size).to eq(0)
56
56
  end
57
57
  end
58
58
 
@@ -65,8 +65,8 @@ describe "Role API operations", type: "acceptance" do
65
65
  it "should return an array of Ridley::RoleObject" do
66
66
  obj = connection.role.all
67
67
 
68
- obj.should have(2).roles
69
- obj.should each be_a(Ridley::RoleObject)
68
+ expect(obj.size).to eq(2)
69
+ expect(obj).to each be_a(Ridley::RoleObject)
70
70
  end
71
71
  end
72
72
 
@@ -76,7 +76,7 @@ describe "Role API operations", type: "acceptance" do
76
76
  let(:target) { connection.role.find(role_name) }
77
77
 
78
78
  it "returns an updated Ridley::RoleObject object" do
79
- connection.role.update(target).should eql(target)
79
+ expect(connection.role.update(target)).to eql(target)
80
80
  end
81
81
 
82
82
  it "saves a new run_list" do
@@ -85,7 +85,7 @@ describe "Role API operations", type: "acceptance" do
85
85
  connection.role.update(target)
86
86
  obj = connection.role.find(target)
87
87
 
88
- obj.run_list.should eql(run_list)
88
+ expect(obj.run_list).to eql(run_list)
89
89
  end
90
90
 
91
91
  it "saves a new env_run_lists" do
@@ -97,7 +97,7 @@ describe "Role API operations", type: "acceptance" do
97
97
  connection.role.update(target)
98
98
  obj = connection.role.find(target)
99
99
 
100
- obj.env_run_lists.should eql(env_run_lists)
100
+ expect(obj.env_run_lists).to eql(env_run_lists)
101
101
  end
102
102
 
103
103
  it "saves a new description" do
@@ -106,7 +106,7 @@ describe "Role API operations", type: "acceptance" do
106
106
  connection.role.update(target)
107
107
  obj = connection.role.find(target)
108
108
 
109
- obj.description.should eql(description)
109
+ expect(obj.description).to eql(description)
110
110
  end
111
111
 
112
112
  it "saves a new default_attributes" do
@@ -120,7 +120,7 @@ describe "Role API operations", type: "acceptance" do
120
120
  connection.role.update(target)
121
121
  obj = connection.role.find(target)
122
122
 
123
- obj.default_attributes.should eql(defaults)
123
+ expect(obj.default_attributes).to eql(defaults)
124
124
  end
125
125
 
126
126
  it "saves a new override_attributes" do
@@ -134,7 +134,7 @@ describe "Role API operations", type: "acceptance" do
134
134
  connection.role.update(target)
135
135
  obj = connection.role.find(target)
136
136
 
137
- obj.override_attributes.should eql(overrides)
137
+ expect(obj.override_attributes).to eql(overrides)
138
138
  end
139
139
  end
140
140
  end
@@ -15,15 +15,15 @@ describe "Sandbox API operations", type: "acceptance" do
15
15
 
16
16
  describe "creating a new sandbox" do
17
17
  it "returns an instance of Ridley::SandboxObject" do
18
- connection.sandbox.create(checksums).should be_a(Ridley::SandboxObject)
18
+ expect(connection.sandbox.create(checksums)).to be_a(Ridley::SandboxObject)
19
19
  end
20
20
 
21
21
  it "contains a value for sandbox_id" do
22
- connection.sandbox.create(checksums).sandbox_id.should_not be_nil
22
+ expect(connection.sandbox.create(checksums).sandbox_id).not_to be_nil
23
23
  end
24
24
 
25
25
  it "returns an instance with the same amount of checksums given to create" do
26
- connection.sandbox.create(checksums).checksums.should have(2).items
26
+ expect(connection.sandbox.create(checksums).checksums.size).to eq(2)
27
27
  end
28
28
  end
29
29
  end
@@ -10,18 +10,18 @@ describe "Search API operations", type: "acceptance" do
10
10
  it "returns an array of indexes" do
11
11
  indexes = connection.search_indexes
12
12
 
13
- indexes.should include("role")
14
- indexes.should include("node")
15
- indexes.should include("client")
16
- indexes.should include("environment")
13
+ expect(indexes).to include("role")
14
+ expect(indexes).to include("node")
15
+ expect(indexes).to include("client")
16
+ expect(indexes).to include("environment")
17
17
  end
18
18
  end
19
19
 
20
20
  describe "searching an index that doesn't exist" do
21
21
  it "it raises a Ridley::Errors::HTTPNotFound error" do
22
- lambda {
22
+ expect {
23
23
  connection.search(:notthere)
24
- }.should raise_error(Ridley::Errors::HTTPNotFound)
24
+ }.to raise_error(Ridley::Errors::HTTPNotFound)
25
25
  end
26
26
  end
27
27
  end