Class: Corundum::RSpecReportTask

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

Instance Method Summary collapse

Methods inherited from RSpecTask

#resolve_runtime_configuration

Instance Method Details

#all_rspec_optionsObject



82
83
84
85
86
# File 'lib/corundum/rspec-task.rb', line 82

def all_rspec_options
  super + formats.inject([]) do |list, (format, target)|
    list + ["--format", format, "--out", target]
  end
end

#default_configuration(rspec) ⇒ Object



78
79
80
# File 'lib/corundum/rspec-task.rb', line 78

def default_configuration(rspec)
  super
end

#needed?Boolean

Returns:

  • (Boolean)


74
75
76
# File 'lib/corundum/rspec-task.rb', line 74

def needed?
  ! File.exist?(doc_path.abspath) || out_of_date?(timestamp)
end

#out_of_date?(stamp) ⇒ Boolean

Returns:

  • (Boolean)


70
71
72
# File 'lib/corundum/rspec-task.rb', line 70

def out_of_date?(stamp)
  prerequisites.any? { |n| application[n, @scope].timestamp > stamp}
end

#resolve_configurationObject



88
89
90
91
# File 'lib/corundum/rspec-task.rb', line 88

def resolve_configuration
  super
  resolve_paths
end

#timestampObject



59
60
61
62
63
64
65
66
67
68
# File 'lib/corundum/rspec-task.rb', line 59

def timestamp
  return Rake::EARLY if formats.empty?
  formats.values.map do |path|
    if File.exist?(path.to_s)
      File.mtime(path.to_s)
    else
      Rake::EARLY
    end
  end.min
end