When a search is used in a recipe, it generates this error:
#<ChefSpec::Error::SearchNotStubbed: Executing a real search is disabled. Unregistered search:
search(:my_search, "*:*")
You can stub this search with:
stub_search("my_search", "*:*").and_return(...)
Should catch this exception and create a stub_search block in the spec.