Class: RuboCop::Cop::RSpec::Extra::RestrictBlockTag
- Inherits:
-
Base
- Object
- Base
- RuboCop::Cop::RSpec::Extra::RestrictBlockTag
- Includes:
- Metadata
- Defined in:
- lib/rubocop/cop/rspec/extra/restrict_block_tag.rb
Overview
Restrict to only allowed block tags.
Instance Method Summary collapse
Instance Method Details
#on_metadata(symbols, hash) ⇒ Object
33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/rubocop/cop/rspec/extra/restrict_block_tag.rb', line 33 def (symbols, hash) symbols += hash.pairs.map(&:key) unless hash.nil? offenses = symbols.filter do |symbol| !.include?(symbol.value.to_s) end return unless offenses.any? offenses.each do |offense| add_offense(offense, message: ) end end |