Class: Danger::DangerSpecPostfix
- Inherits:
-
Plugin
- Object
- Plugin
- Danger::DangerSpecPostfix
- Defined in:
- lib/spec_postfix/plugin.rb
Overview
Lints the test files. Will fail if any has no ‘_spec’ postfix. Generates a ‘string` with warning.
Instance Method Summary collapse
Instance Method Details
#lint ⇒ Object
33 34 35 36 37 38 |
# File 'lib/spec_postfix/plugin.rb', line 33 def lint changed_files.select { |f| f.match?(%r{^spec/.*rb$}) } .reject { |f| f.end_with?('_spec.rb') } .reject { |f| Danger.configuration.spec_postfix_exceptions.any? { |e| f.start_with?(e) } } .each { |f| warn(warning_generator(f)) } end |