Created
May 2, 2012 19:16
-
-
Save calavera/2579422 to your computer and use it in GitHub Desktop.
minitest-chef-handler recipe
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| gem_package "minitest" do | |
| action :nothing | |
| end.run_action(:upgrade) | |
| gem_package "minitest-chef-handler" do | |
| action :nothing | |
| end.run_action(:upgrade) | |
| require 'rubygems' | |
| Gem.clear_paths | |
| require 'minitest-chef-handler' | |
| # The path is not mandatory if you're using minitest-chef-handler 0.5.0 or above. | |
| # The gem autodetects your tests inside the cookbooks. | |
| path = File.join(Chef::Config[:cookbook_path], | |
| "**", | |
| "test", | |
| "test_*.rb") | |
| Chef::Log.info "path is #{path}, entries: #{Dir.glob(path).entries}" | |
| handler = MiniTest::Chef::Handler.new(:path => path) | |
| Chef::Client.send(:report_handlers) << handler |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment