spec/acceptance/node_resource_spec.rb in ridley-0.11.2 vs spec/acceptance/node_resource_spec.rb in ridley-0.12.0.rc1

- old
+ new

@@ -21,15 +21,13 @@ it "returns a new Ridley::NodeObject object" do connection.node.create(name: node_name).should be_a(Ridley::NodeObject) end it "adds a new node to the server" do - connection.sync do - node.create(name: node_name) + connection.node.create(name: node_name) - node.all.should have(1).node - end + connection.node.all.should have(1).node end end describe "deleting a node" do let(:node_name) { "ridley.localhost" } @@ -38,46 +36,40 @@ it "returns a Ridley::NodeObject" do connection.node.delete(node_name).should be_a(Ridley::NodeObject) end it "removes the node from the server" do - connection.sync do - node.delete(node_name) + connection.node.delete(node_name) - node.find(node_name).should be_nil - end + connection.node.find(node_name).should be_nil end end describe "deleting all nodes" do before do chef_node("ridley.localhost") chef_node("motherbrain.localhost") end it "deletes all nodes from the remote server" do - connection.sync do - node.delete_all + connection.node.delete_all - node.all.should have(0).nodes - end + connection.node.all.should have(0).nodes end end describe "listing all nodes" do before do chef_node("ridley.localhost") chef_node("motherbrain.localhost") end it "returns an array of Ridley::NodeObject" do - connection.sync do - obj = node.all + obj = connection.node.all - obj.should each be_a(Ridley::NodeObject) - obj.should have(2).nodes - end + obj.should each be_a(Ridley::NodeObject) + obj.should have(2).nodes end end describe "updating a node" do let(:node_name) { "ridley.localhost" } @@ -94,84 +86,72 @@ "nested" => { "other" => "val" } } - connection.sync do - node.update(target) - obj = node.find(target) + connection.node.update(target) + obj = connection.node.find(target) - obj.normal.should eql(normal) - end + obj.normal.should eql(normal) end it "saves a new set of 'default' attributes" do target.default = defaults = { "attribute_one" => "val_one", "nested" => { "other" => "val" } } - connection.sync do - node.update(target) - obj = node.find(target) + connection.node.update(target) + obj = connection.node.find(target) - obj.default.should eql(defaults) - end + obj.default.should eql(defaults) end it "saves a new set of 'automatic' attributes" do target.automatic = automatics = { "attribute_one" => "val_one", "nested" => { "other" => "val" } } - connection.sync do - node.update(target) - obj = node.find(target) + connection.node.update(target) + obj = connection.node.find(target) - obj.automatic.should eql(automatics) - end + obj.automatic.should eql(automatics) end it "saves a new set of 'override' attributes" do target.override = overrides = { "attribute_one" => "val_one", "nested" => { "other" => "val" } } - connection.sync do - node.update(target) - obj = node.find(target) + connection.node.update(target) + obj = connection.node.find(target) - obj.override.should eql(overrides) - end + obj.override.should eql(overrides) end it "places a node in a new 'chef_environment'" do target.chef_environment = environment = "ridley" - connection.sync do - node.update(target) - obj = node.find(target) + connection.node.update(target) + obj = connection.node.find(target) - obj.chef_environment.should eql(environment) - end + obj.chef_environment.should eql(environment) end it "saves a new 'run_list' for the node" do target.run_list = run_list = ["recipe[one]", "recipe[two]"] - connection.sync do - node.update(target) - obj = node.find(target) + connection.node.update(target) + obj = connection.node.find(target) - obj.run_list.should eql(run_list) - end + obj.run_list.should eql(run_list) end end end