Sha256: 899a60e4c198307e7a2852fa6b2427f081bdec3250d1a5786e44113afe3e7f17

Contents?: true

Size: 545 Bytes

Versions: 4

Compression:

Stored size: 545 Bytes

Contents

module PolishGeeks
  module DevTools
    module Validators
      # It verifies if SimpleCov is available
      class Simplecov < Base
        # Regexp used to match code coverage from Simplecov generated output
        MATCH_REGEXP = /\(\d+.\d+\%\) covered/

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

        # Searches if we have SimpleCov hooked to rspec
        def output
          @output ||= @stored_output.rspec[*MATCH_REGEXP]
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
polishgeeks-dev-tools-1.4.0 lib/polish_geeks/dev_tools/validators/simplecov.rb
polishgeeks-dev-tools-1.3.2 lib/polish_geeks/dev_tools/validators/simplecov.rb
polishgeeks-dev-tools-1.3.1 lib/polish_geeks/dev_tools/validators/simplecov.rb
polishgeeks-dev-tools-1.3.0 lib/polish_geeks/dev_tools/validators/simplecov.rb