test/integration/cookbooks/node-tests/libraries/helper.rb in kitchen-nodes-0.7.0 vs test/integration/cookbooks/node-tests/libraries/helper.rb in kitchen-nodes-0.8.0
- old
+ new
@@ -1,6 +1,6 @@
-require 'timeout'
+require 'timeout'
def search_for_nodes(query, timeout = 120)
nodes = []
Timeout.timeout(timeout) do
nodes = search(:node, query)
@@ -8,10 +8,10 @@
sleep 5
nodes = search(:node, query)
end
end
- if nodes.count == 0 || !nodes[0].key?('ipaddress')
+ if nodes.count.zero? || !nodes[0].key?('ipaddress')
raise "Unable to find any nodes meeting the search criteria '#{query}'!"
end
nodes
end