Module: MiniTest::Assertions::RemoteChef

Includes:
ChefHelper
Included in:
Unit::TestCase
Defined in:
lib/chef-workflow/helpers/minitest.rb

Overview

Small assertion library for minitest to assist with remote chef tests.

Instance Method Summary collapse

Methods included from ChefHelper

#perform_search

Instance Method Details

#assert_search(type, query, node_names) ⇒ Object

Assert that a search included the node names.



13
14
15
# File 'lib/chef-workflow/helpers/minitest.rb', line 13

def assert_search(type, query, node_names)
  assert_equal(node_names.sort, perform_search(type, query).sort)
end

#assert_search_count(type, query, count) ⇒ Object

Assert the search included ‘count` elements. Does not verify what that count is of.



28
29
30
# File 'lib/chef-workflow/helpers/minitest.rb', line 28

def assert_search_count(type, query, count)
  assert_equal(count, perform_search(type, query).count)
end

#refute_search(type, query, node_names) ⇒ Object

Refute that a search included the node names.



20
21
22
# File 'lib/chef-workflow/helpers/minitest.rb', line 20

def refute_search(type, query, node_names)
  refute_equal(node_names.sort, perform_search(type, query).sort)
end

#refute_search_count(type, query, count) ⇒ Object

Refute the search included ‘count` elements. Does not verify what that count is of.



36
37
38
# File 'lib/chef-workflow/helpers/minitest.rb', line 36

def refute_search_count(type, query, count)
  refute_equal(count, perform_search(type, query).count) 
end