Sha256: 601ef59665e82e601922b1bdde3433c875e8911ea685d581cb1b2d8f096d7c43

Contents?: true

Size: 615 Bytes

Versions: 6

Compression:

Stored size: 615 Bytes

Contents

# frozen_string_literal: true
module Cucumber
  module Filters
    class TagLimits

      class TestCaseIndex
        def initialize
          @index = Hash.new { |hash, key| hash[key] = [] }
        end

        def add(test_case)
          test_case.tags.map(&:name).each do |tag_name|
            index[tag_name] << test_case
          end
        end

        def count_by_tag_name(tag_name)
          index[tag_name].count
        end

        def locations_of_tag_name(tag_name)
          index[tag_name].map(&:location)
        end

        private

        attr_accessor :index
      end

    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
cucumber-3.1.0 lib/cucumber/filters/tag_limits/test_case_index.rb
cucumber-3.0.2 lib/cucumber/filters/tag_limits/test_case_index.rb
cucumber-3.0.1 lib/cucumber/filters/tag_limits/test_case_index.rb
cucumber-3.0.0 lib/cucumber/filters/tag_limits/test_case_index.rb
cucumber-3.0.0.pre.2 lib/cucumber/filters/tag_limits/test_case_index.rb
cucumber-3.0.0.pre.1 lib/cucumber/filters/tag_limits/test_case_index.rb