Skip to content

Instantly share code, notes, and snippets.

@leifmadsen
Created September 24, 2012 19:29
Show Gist options
  • Save leifmadsen/3777809 to your computer and use it in GitHub Desktop.
Save leifmadsen/3777809 to your computer and use it in GitHub Desktop.
minitest-chef-handler updates for provider_for_resource
NameError: Cannot find a resource for must_be_installed on centos version 5.8
/usr/local/lib/ruby/gems/1.9.1/gems/chef-10.14.2/lib/chef/resource_platform_map.rb:126:in `get'
/usr/local/lib/ruby/gems/1.9.1/gems/chef-10.14.2/lib/chef/resource.rb:837:in `resource_for_platform'
/usr/local/lib/ruby/gems/1.9.1/gems/chef-10.14.2/lib/chef/resource.rb:854:in `resource_for_node'
/usr/local/lib/ruby/gems/1.9.1/gems/chef-10.14.2/lib/chef/mixin/recipe_definition_dsl_core.rb:58:in `method_missing'
/var/chef/minitest/voiceaxis/init_test.rb:70:in `block (4 levels) in <top (required)>'
diff --git a/lib/minitest-chef-handler/resources.rb b/lib/minitest-chef-handler/resources.rb
index 07fee97..cff5440 100644
--- a/lib/minitest-chef-handler/resources.rb
+++ b/lib/minitest-chef-handler/resources.rb
@@ -14,7 +14,7 @@ module MiniTest
required_args.each do |arg|
res.send(arg, options.first[arg])
end
- provider = ::Chef::Platform.provider_for_resource(res)
+ provider = ::Chef::Platform.provider_for_resource(res, :create)
provider.load_current_resource
provider.current_resource
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment