class Cucumber::Filters::TagLimits::TestCaseIndex

Attributes

index[RW]

Public Class Methods

new() click to toggle source
# File lib/cucumber/filters/tag_limits/test_case_index.rb, line 7
def initialize
  @index = Hash.new { |hash, key| hash[key] = [] }
end

Public Instance Methods

add(test_case) click to toggle source
# File lib/cucumber/filters/tag_limits/test_case_index.rb, line 11
def add(test_case)
  test_case.tags.map(&:name).each do |tag_name|
    index[tag_name] << test_case
  end
end
count_by_tag_name(tag_name) click to toggle source
# File lib/cucumber/filters/tag_limits/test_case_index.rb, line 17
def count_by_tag_name(tag_name)
  index[tag_name].count
end
locations_of_tag_name(tag_name) click to toggle source
# File lib/cucumber/filters/tag_limits/test_case_index.rb, line 21
def locations_of_tag_name(tag_name)
  index[tag_name].map(&:location)
end