Sha256: ef5a144c57daff7e5be483f04e21ed82f8c3c0ece4a004d7409baa25b041ff78

Contents?: true

Size: 1.04 KB

Versions: 19

Compression:

Stored size: 1.04 KB

Contents

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
      attr_reader :test_case_index
      attr_reader :verifier
    end

  end
end

Version data entries

19 entries across 19 versions & 2 rubygems

Version Path
cucumber-2.99.0 lib/cucumber/filters/tag_limits.rb
mobiusloop-0.1.5 lib/cucumber/filters/tag_limits.rb
cucumber-2.4.0 lib/cucumber/filters/tag_limits.rb
mobiusloop-0.1.3 lib/cucumber/filters/tag_limits.rb
mobiusloop-0.1.2 lib/cucumber/filters/tag_limits.rb
cucumber-2.3.3 lib/cucumber/filters/tag_limits.rb
cucumber-2.3.2 lib/cucumber/filters/tag_limits.rb
cucumber-2.3.1 lib/cucumber/filters/tag_limits.rb
cucumber-2.3.0 lib/cucumber/filters/tag_limits.rb
cucumber-2.2.0 lib/cucumber/filters/tag_limits.rb
cucumber-2.1.0 lib/cucumber/filters/tag_limits.rb
cucumber-2.0.2 lib/cucumber/filters/tag_limits.rb
cucumber-2.0.1 lib/cucumber/filters/tag_limits.rb
cucumber-2.0.0 lib/cucumber/filters/tag_limits.rb
cucumber-2.0.0.rc.5 lib/cucumber/filters/tag_limits.rb
cucumber-2.0.0.rc.4 lib/cucumber/filters/tag_limits.rb
cucumber-2.0.0.rc.3 lib/cucumber/filters/tag_limits.rb
cucumber-2.0.0.rc.2 lib/cucumber/filters/tag_limits.rb
cucumber-2.0.0.rc.1 lib/cucumber/filters/tag_limits.rb