Skip to content

Instantly share code, notes, and snippets.

Created March 8, 2015 08:27
Show Gist options
  • Save anonymous/f5e317f80d01c8dcd9f0 to your computer and use it in GitHub Desktop.
Save anonymous/f5e317f80d01c8dcd9f0 to your computer and use it in GitHub Desktop.
# Public: Stubs partial search
# Examples =>
# stub_partial_search(:node, 'name:web*').and_return([{ 'fqdn' => 'web01.example.com' }])
#
def stub_partial_search(type, query)
allow(Chef).to receive(:partial_search).and_call_original
expect(Chef).to receive(:partial_search).with(type, query, any_args)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment