Method: ChefSpec::API::Stubs#stub_search
- Defined in:
- lib/chefspec/api/stubs.rb
#stub_search(type, query = "*:*", &block) ⇒ ChefSpec::SearchStub
Stub a Chef search to return pre-defined data. When providing a value, the value is automatically mashified (to the best of ChefSpec’s abilities) to ease in use.
168 169 170 |
# File 'lib/chefspec/api/stubs.rb', line 168 def stub_search(type, query = "*:*", &block) ChefSpec::Stubs::SearchRegistry.register(ChefSpec::Stubs::SearchStub.new(type, query, &block)) end |