Class: RakeCommandFilter::RSpecCommandDefinition

Inherits:
RakeCommandDefinition show all
Defined in:
lib/rspec_command_definition.rb

Overview

default way to run rubocop and parse its output

Instance Attribute Summary

Attributes inherited from RakeCommandDefinition

#test_command

Attributes inherited from CommandDefinition

#default_line_handling, #filter, #name

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from RakeCommandDefinition

#execute

Methods inherited from CommandDefinition

#add_filter, #add_parameter, create_result, #execute, find_worst_result, result_failure, result_success, result_warning

Constructor Details

#initialize(coverage_threshold = 95, id = :spec) ⇒ RSpecCommandDefinition

Default parser for rspec output.

Parameters:

  • id (defaults to: :spec)

    override this if you want to do something other than ‘rake spec’



21
22
23
24
25
26
# File 'lib/rspec_command_definition.rb', line 21

def initialize(coverage_threshold = 95, id = :spec)
  super(id, 'rspec')
  # just use sensible defaults here.
  add_rspec
  add_simplecov(coverage_threshold)
end

Class Method Details

.coverage_msg(percent) ⇒ Object

for testing



15
16
17
# File 'lib/rspec_command_definition.rb', line 15

def self.coverage_msg(percent)
  "#{percent} test coverage"
end

.failure_msg(failures) ⇒ Object

for testing



5
6
7
# File 'lib/rspec_command_definition.rb', line 5

def self.failure_msg(failures)
  "#{failures} failed"
end

.success_msg(success) ⇒ Object

for testing



10
11
12
# File 'lib/rspec_command_definition.rb', line 10

def self.success_msg(success)
  "#{success} passed"
end