Sha256: d7f9f033c49cf2b0b43d2d753c2443909979c129539778330430e91ceed90f88

Contents?: true

Size: 707 Bytes

Versions: 24

Compression:

Stored size: 707 Bytes

Contents

module Cucumber
  module Ast
    class Features #:nodoc:
      include Enumerable

      attr_reader :duration

      def initialize
        @features = []
      end

      def [](index)
        @features[index]
      end

      def each(&proc)
        @features.each(&proc)
      end

      def add_feature(feature)
        @features << feature
      end

      def accept(visitor)
        return if Cucumber.wants_to_quit
        start = Time.now
        self.each do |feature|
          visitor.visit_feature(feature)
        end
        @duration = Time.now - start
      end

      def step_count
        @features.inject(0) { |total, feature| total += feature.step_count }
      end
    end
  end
end

Version data entries

24 entries across 22 versions & 2 rubygems

Version Path
honeybadger-2.4.0 vendor/gems/ruby/2.1.0/gems/cucumber-1.3.16/lib/cucumber/ast/features.rb
honeybadger-2.4.0 vendor/gems/ruby/2.2.0/gems/cucumber-1.3.18/lib/cucumber/ast/features.rb
honeybadger-2.4.0 vendor/gems/ruby/1.9.1/gems/cucumber-1.3.18/lib/cucumber/ast/features.rb
cucumber-1.3.20 lib/cucumber/ast/features.rb
cucumber-1.3.19 lib/cucumber/ast/features.rb
cucumber-1.3.18 lib/cucumber/ast/features.rb
cucumber-1.3.17 lib/cucumber/ast/features.rb
cucumber-1.3.16 lib/cucumber/ast/features.rb
cucumber-1.3.15 lib/cucumber/ast/features.rb
cucumber-1.3.14 lib/cucumber/ast/features.rb
cucumber-1.3.13 lib/cucumber/ast/features.rb
cucumber-1.3.12 lib/cucumber/ast/features.rb
cucumber-1.3.11 lib/cucumber/ast/features.rb
cucumber-1.3.10 lib/cucumber/ast/features.rb
cucumber-1.3.9 lib/cucumber/ast/features.rb
cucumber-1.3.8 lib/cucumber/ast/features.rb
cucumber-1.3.7 lib/cucumber/ast/features.rb
cucumber-1.3.6 lib/cucumber/ast/features.rb
cucumber-1.3.5 lib/cucumber/ast/features.rb
cucumber-1.3.4 lib/cucumber/ast/features.rb