Sha256: 1afee408e27ca3bd47a70eb899c96796957ab65c94df08dd29220fcff98745cd

Contents?: true

Size: 614 Bytes

Versions: 40

Compression:

Stored size: 614 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

40 entries across 40 versions & 4 rubygems

Version Path
cucumber-9.2.0 lib/cucumber/filters/tag_limits/test_case_index.rb
cucumber-9.1.2 lib/cucumber/filters/tag_limits/test_case_index.rb
cucumber-9.1.1 lib/cucumber/filters/tag_limits/test_case_index.rb
honeybadger-5.4.0 vendor/bundle/ruby/3.2.0/gems/cucumber-9.1.0/lib/cucumber/filters/tag_limits/test_case_index.rb
cucumber-9.1.0 lib/cucumber/filters/tag_limits/test_case_index.rb
honeybadger-5.3.0 vendor/bundle/ruby/3.2.0/gems/cucumber-9.0.2/lib/cucumber/filters/tag_limits/test_case_index.rb
cucumber-9.0.2 lib/cucumber/filters/tag_limits/test_case_index.rb
cucumber-9.0.1 lib/cucumber/filters/tag_limits/test_case_index.rb
cucumber-9.0.0 lib/cucumber/filters/tag_limits/test_case_index.rb
rubypitaya-3.12.5 ./lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-8.0.0/lib/cucumber/filters/tag_limits/test_case_index.rb
rubypitaya-3.12.4 ./lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-8.0.0/lib/cucumber/filters/tag_limits/test_case_index.rb
rubypitaya-3.12.3 ./lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-8.0.0/lib/cucumber/filters/tag_limits/test_case_index.rb
rubypitaya-3.12.2 ./lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/cucumber-8.0.0/lib/cucumber/filters/tag_limits/test_case_index.rb
cucumber-8.0.0 lib/cucumber/filters/tag_limits/test_case_index.rb
cucumber-8.0.0.rc.1 lib/cucumber/filters/tag_limits/test_case_index.rb
phillipug-foodie-0.1.0 .vendor/ruby/3.0.0/gems/cucumber-7.1.0/lib/cucumber/filters/tag_limits/test_case_index.rb
cucumber-7.1.0 lib/cucumber/filters/tag_limits/test_case_index.rb
cucumber-7.0.0 lib/cucumber/filters/tag_limits/test_case_index.rb
cucumber-6.1.0 lib/cucumber/filters/tag_limits/test_case_index.rb
cucumber-6.0.0 lib/cucumber/filters/tag_limits/test_case_index.rb