btm/minitest-handler-cookbook — pull request #35 by charlesjohnson (2013-03-05 21:44:15+00:00)
Title: Add test files to minitest-handler cookbook

Added default_test.rb and support/helpers.rb files to the cookbook. This serves two purposes:

1. Give people new to minitest-handler an idea of how their test files should be structured, using code comments as examples.
2. Removes 138 lines of false positive file-missing errors from the Chef-client output when minitest-handler is in the run_list. Examples of these false positives below.

```
[2013-03-05T20:54:22+00:00] ERROR: cookbook_file[tests-minitest-handler-default] (minitest-handler::default line 53) had an error: Cookbook 'minitest-handler' (0.1.2) does not contain a file at any of these locations:
files/centos-5.8/tests/minitest/default_test.rb
files/centos/tests/minitest/default_test.rb
files/default/tests/minitest/default_test.rb; ignore_failure is set, continuing

================================================================================

Error executing action `create` on resource 'cookbook_file[tests-minitest-handler-default]'

================================================================================

Chef::Exceptions::FileNotFound

------------------------------

Cookbook 'minitest-handler' (0.1.2) does not contain a file at any of these locations:
files/centos-5.8/tests/minitest/default_test.rb
files/centos/tests/minitest/default_test.rb
files/default/tests/minitest/default_test.rb

Resource Declaration:

---------------------

# In /tmp/vagrant-chef-1/chef-solo-1/cookbooks/minitest-handler/recipes/default.rb

53: cookbook_file "tests-#{cookbook_name}-#{recipe_name}" do
54: source "tests/minitest/#{recipe_name}_test.rb"
55: cookbook cookbook_name
56: path "#{node['minitest']['path']}/#{cookbook_name}/#{recipe_name}_test.rb"
57: ignore_failure true
58: end
59: # copy any helper files from the support directory

Compiled Resource:

------------------

# Declared in /tmp/vagrant-chef-1/chef-solo-1/cookbooks/minitest-handler/recipes/default.rb:53:in `block in from_file'

cookbook_file("tests-minitest-handler-default") do
provider Chef::Provider::CookbookFile
action "create"
ignore_failure true
retries 0
retry_delay 2
path "/var/chef/minitest/minitest-handler/default_test.rb"
backup 5
source "tests/minitest/default_test.rb"
cookbook "minitest-handler"
cookbook_name :"minitest-handler"
recipe_name "default"
end

[2013-03-05T20:54:22+00:00] INFO: Processing remote_directory[tests-support-minitest-handler-default] action create (minitest-handler::default line 60)
[2013-03-05T20:54:22+00:00] ERROR: remote_directory[tests-support-minitest-handler-default] (minitest-handler::default line 60) had an error: cookbook minitest-handler has no directory files/default/tests/minitest/support; ignore_failure is set, continuing

================================================================================

Error executing action `create` on resource 'remote_directory[tests-support-minitest-handler-default]'

================================================================================

Chef::Exceptions::FileNotFound

------------------------------

cookbook minitest-handler has no directory files/default/tests/minitest/support

Resource Declaration:

---------------------

# In /tmp/vagrant-chef-1/chef-solo-1/cookbooks/minitest-handler/recipes/default.rb

60: remote_directory "tests-support-#{cookbook_name}-#{recipe_name}" do
61: source "tests/minitest/support"
62: cookbook cookbook_name
63: path "#{node['minitest']['path']}/#{cookbook_name}/support"
64: recursive true
65: ignore_failure true
66: end
67: end

Compiled Resource:

------------------

# Declared in /tmp/vagrant-chef-1/chef-solo-1/cookbooks/minitest-handler/recipes/default.rb:60:in `block in from_file'

remote_directory("tests-support-minitest-handler-default") do
provider Chef::Provider::RemoteDirectory
action :create
ignore_failure true
retries 0
retry_delay 2
path "/var/chef/minitest/minitest-handler/support"
recursive true
source "tests/minitest/support"
files_backup 5
files_mode 420
overwrite true
cookbook "minitest-handler"
cookbook_name :"minitest-handler"
recipe_name "default"
owner "root"
group "root"
mode "0755"
end

[2013-03-05T20:54:22+00:00] INFO: Processing directory[/var/chef/minitest/bluekai-chef-lighttpd] action create (minitest-handler::default line 50)
```