Class: PolishGeeks::DevTools::Validators::Simplecov

Inherits:
Base
  • Object
show all
Defined in:
lib/polish_geeks/dev_tools/validators/simplecov.rb

Overview

It verifies if SimpleCov is available

Constant Summary collapse

MATCH_REGEXP =

Regexp used to match code coverage from Simplecov generated output

/\(\d+.\d+\%\) covered/

Instance Method Summary collapse

Methods inherited from Base

#initialize, #validate!

Constructor Details

This class inherits a constructor from PolishGeeks::DevTools::Validators::Base

Instance Method Details

#outputObject

Searches if we have SimpleCov hooked to rspec



14
15
16
# File 'lib/polish_geeks/dev_tools/validators/simplecov.rb', line 14

def output
  @output ||= @stored_output.rspec[*MATCH_REGEXP]
end

#valid?Boolean

Returns:

  • (Boolean)


9
10
11
# File 'lib/polish_geeks/dev_tools/validators/simplecov.rb', line 9

def valid?
  Object.const_defined?('SimpleCov') || (!output.nil? && !output.empty?)
end