Class: GemLint::Strategies::TestFilesInFilesAttributeStrategy

Inherits:
AbstractStrategy
  • Object
show all
Defined in:
lib/gem_lint/strategies/test_files_in_files_attribute_strategy.rb

Instance Attribute Summary

Attributes inherited from AbstractStrategy

#filename, #metadata_path, #path

Instance Method Summary collapse

Methods inherited from AbstractStrategy

#initialize, #level_char

Constructor Details

This class inherits a constructor from GemLint::Strategies::AbstractStrategy

Instance Method Details

#descriptionObject



7
8
9
# File 'lib/gem_lint/strategies/test_files_in_files_attribute_strategy.rb', line 7

def description
  "Gem metadata includes test files in files attribute. Use test_files instead"
end

#fail?Boolean

Returns:

  • (Boolean)


19
20
21
22
23
# File 'lib/gem_lint/strategies/test_files_in_files_attribute_strategy.rb', line 19

def fail?
  orig_files.any? { |filename|
    filename[-8,8] == "_spec.rb" || filename[-8,8] == "_test.rb"
  }
end

#levelObject



15
16
17
# File 'lib/gem_lint/strategies/test_files_in_files_attribute_strategy.rb', line 15

def level
  :warning
end

#tagObject



11
12
13
# File 'lib/gem_lint/strategies/test_files_in_files_attribute_strategy.rb', line 11

def tag
  :"test-files-in-files-attribute"
end