btm/minitest-handler-cookbook — pull request #12 by hectcastro (2012-05-28 15:31:09+00:00)
Title: Ensure minitest gem is used

I added `minitest-handler-cookbook` to the run list of a node with Ruby `1.9.2-p290` and received the following error:

[Mon, 28 May 2012 14:52:51 +0000] INFO: *** Chef 0.10.10 ***
[Mon, 28 May 2012 14:52:52 +0000] INFO: Setting the run_list to ["recipe[minitest-handler]", "recipe[wharton-networks]", "recipe[sshd]", "recipe[apt]", "recipe[apt::cacher-ng]", "recipe[ntp]", "recipe[sudo]", "recipe[wharton-users]"] from JSON
[Mon, 28 May 2012 14:52:52 +0000] INFO: Run List is [recipe[minitest-handler], recipe[wharton-networks], recipe[sshd], recipe[apt], recipe[apt::cacher-ng], recipe[ntp], recipe[sudo], recipe[wharton-users]]
[Mon, 28 May 2012 14:52:52 +0000] INFO: Run List expands to [minitest-handler, wharton-networks, sshd, apt, apt::cacher-ng, ntp, sudo, wharton-users]
[Mon, 28 May 2012 14:52:52 +0000] INFO: Starting Chef Run for vagrant.vm
[Mon, 28 May 2012 14:52:52 +0000] INFO: Running start handlers
[Mon, 28 May 2012 14:52:52 +0000] INFO: Start handlers complete.
[Mon, 28 May 2012 14:52:52 +0000] INFO: Processing gem_package[minitest] action install (minitest-handler::default line 2)
[Mon, 28 May 2012 14:52:52 +0000] INFO: Processing gem_package[minitest-chef-handler] action install (minitest-handler::default line 6)
[Mon, 28 May 2012 14:53:08 +0000] INFO: gem_package[minitest-chef-handler] installed version 0.5.0
[Mon, 28 May 2012 14:53:08 +0000] ERROR: Running exception handlers
[Mon, 28 May 2012 14:53:08 +0000] ERROR: Exception handlers complete
[Mon, 28 May 2012 14:53:08 +0000] FATAL: Stacktrace dumped to /tmp/vagrant-chef-1/chef-stacktrace.out
[Mon, 28 May 2012 14:53:08 +0000] FATAL: NoMethodError: undefined method `register_spec_type' for MiniTest::Spec:Class

After ensuring that the minitest gem gets used instead of Ruby's built-in minitest, the Chef run completes successfully.