spec/beaker/shared/host_manager_spec.rb in beaker-3.35.0 vs spec/beaker/shared/host_manager_spec.rb in beaker-3.36.0
- old
+ new
@@ -96,10 +96,14 @@
it "throws an error when no host is found matching the role" do
expect{ host_handler.only_host_with_role( hosts, 'surprise' ) }.to raise_error(ArgumentError)
end
+
+ it "throws an error when role = nil" do
+ expect{ host_handler.find_at_most_one_host_with_role( hosts, nil ) }.to raise_error(ArgumentError)
+ end
end
context "#find_at_most_one_host_with_role" do
it "can find the single master in a set of hosts" do
@@ -115,9 +119,13 @@
it "returns nil when no host is found matching the role" do
expect( host_handler.find_at_most_one_host_with_role( hosts, 'surprise' ) ).to be_nil
+ end
+
+ it "throws an error when role = nil" do
+ expect{ host_handler.find_at_most_one_host_with_role( hosts, nil ) }.to raise_error(ArgumentError)
end
end
context "#run_block_on" do
it "can execute a block against hosts identified by a string" do