Class: Hydra::TestTask
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
t.autosort = false # disable automatic sorting based on runtime of tests
end
Instance Attribute Summary
Attributes inherited from Task
#autosort, #config, #environment, #files, #listeners, #name, #runner_log_file, #serial, #show_time, #verbose
Instance Method Summary collapse
-
#initialize(name = :hydra) {|_self| ... } ⇒ TestTask
constructor
Create a new HydraTestTask.
Methods inherited from Task
Constructor Details
#initialize(name = :hydra) {|_self| ... } ⇒ TestTask
Create a new HydraTestTask
80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 |
# File 'lib/hydra/tasks.rb', line 80 def initialize(name = :hydra) @name = name @files = [] @verbose = false @autosort = true @serial = false @listeners = [Hydra::Listener::ProgressBar.new] @show_time = true yield self if block_given? # Ensure we override rspec's at_exit if defined?(RSpec) RSpec::Core::Runner.disable_autorun! end unless @serial @config = find_config_file end @opts = { :verbose => @verbose, :autosort => @autosort, :files => @files, :listeners => @listeners, :environment => @environment, :runner_log_file => @runner_log_file } if @config @opts.merge!(:config => @config) else @opts.merge!(:workers => [{:type => :local, :runners => 1}]) end define end |