Sha256: 914e26af513c625c2c1bb83d18d12ab5c7e4489bcfcd58996675ded635f8b9cb

Contents?: true

Size: 583 Bytes

Versions: 3

Compression:

Stored size: 583 Bytes

Contents

module Cucumber
  class Runtime
    module 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

3 entries across 3 versions & 1 rubygems

Version Path
cucumber-2.0.0.beta.3 lib/cucumber/runtime/tag_limits/test_case_index.rb
cucumber-2.0.0.beta.2 lib/cucumber/runtime/tag_limits/test_case_index.rb
cucumber-2.0.0.beta.1 lib/cucumber/runtime/tag_limits/test_case_index.rb