Class: Corundum::RSpecReportTask

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

Instance Method Summary collapse

Methods inherited from RSpecTask

#resolve_configuration

Instance Method Details

#default_configuration(rspec) ⇒ Object



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

def default_configuration(rspec)
  super
  self.doc_path = File::join(target_dir, doc_file)
end

#needed?Boolean

Returns:

  • (Boolean)


65
66
67
# File 'lib/corundum/rspec-task.rb', line 65

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

#out_of_date?(stamp) ⇒ Boolean

Returns:

  • (Boolean)


61
62
63
# File 'lib/corundum/rspec-task.rb', line 61

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

#timestampObject



53
54
55
56
57
58
59
# File 'lib/corundum/rspec-task.rb', line 53

def timestamp
  if File.exist?(doc_path)
    File.mtime(doc_path.to_s)
  else
    Rake::EARLY
  end
end