Class: NeetoCompliance::SimplecovConfigVerifier

Inherits:
Base
  • Object
show all
Defined in:
lib/neeto_compliance/verifiers/simplecov_config_verifier.rb

Instance Method Summary collapse

Methods inherited from Base

#app_is_exception?, #app_name, #apps_exception_list, #audit, #auto_correct!, #error_message, #print_description, #process, #verifier_name

Instance Method Details

#autofix_commandObject



25
26
27
# File 'lib/neeto_compliance/verifiers/simplecov_config_verifier.rb', line 25

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

#autofix_suggestionObject



21
22
23
# File 'lib/neeto_compliance/verifiers/simplecov_config_verifier.rb', line 21

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

#test_helperObject



5
6
7
# File 'lib/neeto_compliance/verifiers/simplecov_config_verifier.rb', line 5

def test_helper
  "test/test_helper.rb"
end

#valid?Boolean

Returns:

  • (Boolean)


9
10
11
12
13
14
15
16
17
18
19
# File 'lib/neeto_compliance/verifiers/simplecov_config_verifier.rb', line 9

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