File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 4747
4848 it "should save the edited node data" do
4949 pansy = Chef ::Node . new
50+ @node . name ( "new_node_name" )
5051 @knife . should_receive ( :edit_data ) . with ( @node ) . and_return ( pansy )
5152 pansy . should_receive ( :save )
5253 @knife . run
5354 end
5455
56+ it "should not save the unedited node data" do
57+ pansy = Chef ::Node . new
58+ @knife . should_receive ( :edit_data ) . with ( @node ) . and_return ( pansy )
59+ pansy . should_not_receive ( :save )
60+ @knife . run
61+ end
62+
5563 it "should not print the node" do
5664 @knife . should_not_receive ( :output ) . with ( "poop" )
5765 @knife . run
Original file line number Diff line number Diff line change 3939 @knife . run
4040 end
4141
42- it "should edit the node data" do
42+ it "should edit the role data" do
4343 @knife . should_receive ( :edit_data ) . with ( @role )
4444 @knife . run
4545 end
4646
47- it "should save the edited node data" do
47+ it "should save the edited role data" do
4848 pansy = Chef ::Role . new
49+
50+ @role . name ( "new_role_name" )
4951 @knife . should_receive ( :edit_data ) . with ( @role ) . and_return ( pansy )
5052 pansy . should_receive ( :save )
5153 @knife . run
5254 end
5355
54- it "should not print the node" do
56+ it "should not save the unedited role data" do
57+ pansy = Chef ::Role . new
58+
59+ @knife . should_receive ( :edit_data ) . with ( @role ) . and_return ( pansy )
60+ pansy . should_not_receive ( :save )
61+ @knife . run
62+
63+ end
64+
65+ it "should not print the role" do
5566 @knife . should_not_receive ( :output )
5667 @knife . run
5768 end
5869
5970 describe "with -p or --print-after" do
60- it "should pretty print the node , formatted for display" do
71+ it "should pretty print the role , formatted for display" do
6172 @knife . config [ :print_after ] = true
6273 @knife . should_receive ( :output ) . with ( @role )
6374 @knife . run
You can’t perform that action at this time.
0 commit comments