class Cucumber::Filters::TagLimits::Verifier
Attributes
tag_limits[R]
Public Class Methods
new(tag_limits)
click to toggle source
# File lib/cucumber/filters/tag_limits/verifier.rb, line 7 def initialize(tag_limits) @tag_limits = tag_limits end
Public Instance Methods
verify!(test_case_index)
click to toggle source
# File lib/cucumber/filters/tag_limits/verifier.rb, line 11 def verify!(test_case_index) breaches = collect_breaches(test_case_index) raise TagLimitExceededError.new(*breaches) unless breaches.empty? end
Private Instance Methods
collect_breaches(test_case_index)
click to toggle source
# File lib/cucumber/filters/tag_limits/verifier.rb, line 18 def collect_breaches(test_case_index) tag_limits.reduce([]) do |breaches, (tag_name, limit)| breaches.tap do |breaches| if test_case_index.count_by_tag_name(tag_name) > limit breaches << Breach.new(tag_name, limit, test_case_index.locations_of_tag_name(tag_name)) end end end end