Method: Covet::CollectionTask#define

Defined in:
lib/covet/collection_task.rb

#defineObject

Define the task



37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# File 'lib/covet/collection_task.rb', line 37

def define
  if @test_task.nil?
    raise "#{self.class} '#{@name}' is not properly set up. " \
      "This task needs a `test_task` that's either the `Rake::TestTask` " \
      "object to test or the name of that `TestTask` object. You can assign " \
      "it using the `test_task=` method on the instance of #{self.class}."
  end
  @description ||= "Collect coverage information for task '#{test_task_name}'"
  desc @description
  task @name do
    cmd = %Q(covet -c "rake #{test_task_name}" #{@covet_opts.join(' ')}).strip
    puts cmd
    system cmd
  end
end