class Hydra::Task

Hydra Task Common attributes and methods

Attributes

autosort[RW]

Automatically sort files using their historical runtimes. Defaults to true To disable:

t.autosort = false
config[RW]

Path to the hydra config file. If not set, it will check 'hydra.yml' and 'config/hydra.yml'

environment[RW]
files[RW]

Files to test. You can add files manually via:

t.files << [file1, file2, etc]

Or you can use the #add_files method

listeners[RW]

Event listeners. Defaults to the MinimalOutput listener. You can add additional listeners if you'd like. For example, on linux (with notify-send) you can add the notifier listener:

t.listeners << Hydra::Listener::Notifier.new
name[RW]

Name of the task. Default 'hydra'

options[RW]

Command line options

runner_log_file[RW]

Set to a valid file path if you want to save the output of the runners in a log file

serial[RW]

Set to true if you want to run this task only on the local machine with one runner. A “Safe Mode” for some test files that may not play nice with others.

show_time[RW]

Set to false if you don't want to show the total running time

verbose[RW]

True if you want to see Hydra's message traces

Public Instance Methods

add_files(pattern) click to toggle source

Add files to test by passing in a string to be run through Dir.glob. For example:

t.add_files 'test/units/*.rb'
# File lib/hydra/tasks.rb, line 67
def add_files(pattern)
  @files += Dir.glob(pattern)
end
find_config_file() click to toggle source

Search for the hydra config file

# File lib/hydra/tasks.rb, line 55
def find_config_file
  @config ||= 'hydra.yml'
  return @config if File.exists?(@config)
  @config = File.join('config', 'hydra.yml')
  return @config if File.exists?(@config)
  @config = nil
end