Sha256: f6e108ddb5b340b41be5fbbadd10c38fe9d27925c43638c3f90c25423589e840

Contents?: true

Size: 671 Bytes

Versions: 1

Compression:

Stored size: 671 Bytes

Contents

# frozen_string_literal: true

module NeetoCompliance
  class SimplecovConfigVerifier < Base
    def test_helper
      "test/test_helper.rb"
    end

    def valid?
      @errors = []

      check_file = Set.new(File.readlines(test_helper).collect(&:chomp))

      if check_file.include?("NeetoCommonsBackend.simplecov_config")
        @errors << "Remove NeetoCommons.simplecov_config from #{test_helper}"
      end

      @errors.length == 0
    end

    def autofix_suggestion
      @errors.join("\n").yellow
    end

    def autofix_command
      "grep -v 'NeetoCommonsBackend.simplecov_config' #{test_helper} > tmpfile && mv tmpfile #{test_helper}"
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
neeto-compliance-1.0.58 lib/neeto_compliance/verifiers/simplecov_config_verifier.rb