Skip to content

ExampleAppSpecificTestMapping

alloy edited this page Sep 13, 2010 · 2 revisions

Application specific test mappings

When you’re working on a Rails application you can use the ‘rails’ recipe that ships with Kicker. Sometimes you have to add a few rules to map files to their tests properly.


process do |files|
  test_files = files.take_and_map do |file|
    case file
    when %r{^app/views/mailer/\w+\.erb$}
      'test/unit/mailer_test.rb'
    when %r{^data/.*\.yml}
      'test/functional/questionnaires_controller_test.rb'
    end
  end

  Ruby.run_tests test_files
end

recipe :rails
Clone this wiki locally