Sha256: 5a5272a50e183233dffa5c33f0df098c87dd1fa5e18a08a1d6262f707e98b8fb

Contents?: true

Size: 1.03 KB

Versions: 16

Compression:

Stored size: 1.03 KB

Contents

# frozen_string_literal: true

require 'cucumber/filters/gated_receiver'
require 'cucumber/filters/tag_limits/test_case_index'
require 'cucumber/filters/tag_limits/verifier'

module Cucumber
  module Filters
    class TagLimitExceededError < StandardError
      def initialize(*limit_breaches)
        super(limit_breaches.map(&:to_s).join("\n"))
      end
    end

    class TagLimits
      def initialize(tag_limits, receiver = nil)
        @tag_limits = tag_limits
        @gated_receiver = GatedReceiver.new(receiver)
        @test_case_index = TestCaseIndex.new
        @verifier = Verifier.new(@tag_limits)
      end

      def test_case(test_case)
        gated_receiver.test_case(test_case)
        test_case_index.add(test_case)
        self
      end

      def done
        verifier.verify!(test_case_index)
        gated_receiver.done
        self
      end

      def with_receiver(receiver)
        self.class.new(@tag_limits, receiver)
      end

      private

      attr_reader :gated_receiver, :test_case_index, :verifier
    end
  end
end

Version data entries

16 entries across 16 versions & 3 rubygems

Version Path
cucumber-9.2.1 lib/cucumber/filters/tag_limits.rb
cucumber-9.2.0 lib/cucumber/filters/tag_limits.rb
cucumber-9.1.2 lib/cucumber/filters/tag_limits.rb
cucumber-9.1.1 lib/cucumber/filters/tag_limits.rb
honeybadger-5.4.0 vendor/bundle/ruby/3.2.0/gems/cucumber-9.1.0/lib/cucumber/filters/tag_limits.rb
cucumber-9.1.0 lib/cucumber/filters/tag_limits.rb
honeybadger-5.3.0 vendor/bundle/ruby/3.2.0/gems/cucumber-9.0.2/lib/cucumber/filters/tag_limits.rb
cucumber-9.0.2 lib/cucumber/filters/tag_limits.rb
cucumber-9.0.1 lib/cucumber/filters/tag_limits.rb
cucumber-9.0.0 lib/cucumber/filters/tag_limits.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.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.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.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.rb
cucumber-8.0.0 lib/cucumber/filters/tag_limits.rb
cucumber-8.0.0.rc.1 lib/cucumber/filters/tag_limits.rb