customink/strainer — pull request #13 by motns (2013-04-02 00:52:37+00:00)
Title: Exclude non-Cookbook files when copying to Sandbox

I was having trouble getting Strainer to work for a single-cookbook repository, mostly because it would copy my cookbook *spec* folder into the sandbox twice - once as a *global* in the root of the sandbox, and then once again inside the cookbook folder. Having the specs inside the cookbook messes with the Foodcritic linting, and also causes trouble when trying to run the specs under `sandbox/specs` - because Rspec seems to traverse the sub-folders, and also finds `sandbox/my_cookbook/spec`.

To get around this, I have modified the sandbox creation class to exclude certain paths when copying a cookbook into the sandbox. One of the entries is "specs", but I have also excluded generic, non-cookbook files which shouldn't be in the test environment (Gemfile, Berksfile, etc.).

This shouldn't impact regular users who run Strainer from a standard Chef repo (with multiple cookbooks), but should be very helpful for single-cookbook repositories (where Strainer is equally useful).

> NOTE: This also includes commits from my earlier pull request