Class: Corundum::RSpecTask

Inherits:
Mattock::Rake::CommandTask
  • Object
show all
Defined in:
lib/corundum/rspec-task.rb

Direct Known Subclasses

RSpecReportTask

Instance Method Summary collapse

Instance Method Details

#default_configuration(rspec) ⇒ Object



18
19
20
21
# File 'lib/corundum/rspec-task.rb', line 18

def default_configuration(rspec)
  super
  rspec.copy_settings_to(self)
end

#resolve_configurationObject



23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# File 'lib/corundum/rspec-task.rb', line 23

def resolve_configuration
  self.rspec_path = %x"which #{rspec_path}".chomp

  ruby_command.options << ruby_opts if ruby_opts
  ruby_command.options << "-w" if warning

  self.runner_command = cmd(rspec_path) do |cmd|
    cmd.options << rspec_opts
    cmd.options << files_to_run
  end

  self.command = ruby_command - runner_command

  super

  if task_args.last.is_a? Hash
    key = task_args.last.keys.first
    task_args.last[key] = [*task_args.last[key]] + file_dependencies
  else
    key = task_args.pop
    task_args << { key => file_dependencies }
  end
end