Class: Hydra::TestTask

Inherits:
Task
  • Object
show all
Defined in:
lib/hydra/tasks.rb

Overview

Define a test task that uses hydra to test the files.

Hydra::TestTask.new('hydra') do |t|
  t.add_files 'test/unit/**/*_test.rb'
  t.add_files 'test/functional/**/*_test.rb'
  t.add_files 'test/integration/**/*_test.rb'
  t.verbose = false # optionally set to true for lots of debug messages
end

Instance Attribute Summary

Attributes inherited from Task

#config, #files, #name, #verbose

Instance Method Summary collapse

Methods inherited from Task

#add_files, #find_config_file

Constructor Details

#initialize(name = :hydra) {|_self| ... } ⇒ TestTask

Create a new HydraTestTask

Yields:

  • (_self)

Yield Parameters:



52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# File 'lib/hydra/tasks.rb', line 52

def initialize(name = :hydra)
  @name = name
  @files = []
  @verbose = false

  yield self if block_given?

  @config = find_config_file

  @opts = {
    :verbose => @verbose,
    :files => @files
  }
  if @config
    @opts.merge!(:config => @config)
  else
    @opts.merge!(:workers => [{:type => :local, :runners => 1}])
  end

  define
end