class Kitchen::Microwave::Suites

The suites config can be generated by examining the `test` wrapper cookbook.

@author Jonathan Hartman <jonathan.hartman@socrata.com>

Public Class Methods

new(cookbook_dir) click to toggle source

Examine the cookbook's test harness and consider any public (i.e. not named with a leading “_”) recipe to be a test suite.

@param [String] cookbook_dir path to the cookbook under test

@return [Kitchen::Microwave::Suites] the new suites object

# File lib/kitchen/microwave/suites.rb, line 36
def initialize(cookbook_dir)
  glob = File.join(cookbook_dir,
                   'test/fixtures/cookbooks/test/recipes/[a-z0-9]*.rb')
  Dir.glob(glob).sort.each do |ste|
    self << {
      'name' => File.basename(ste, '.rb'),
      'run_list' => %W[recipe[test::#{File.basename(ste, '.rb')}]]
    }
  end
end