Sha256: d551e65375ca60cc9c8a9edef94008eb0b346a0382b8f0e9cc7d555597727eea

Contents?: true

Size: 766 Bytes

Versions: 13

Compression:

Stored size: 766 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)
        feature.features = self
        @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 tag_count(tag)
        @features.inject(0){|count, feature| count += feature.feature_and_children_tag_count(tag)}
      end

    end
  end
end

Version data entries

13 entries across 13 versions & 4 rubygems

Version Path
cucumber-0.5.3 lib/cucumber/ast/features.rb
cucumber-0.5.2 lib/cucumber/ast/features.rb
cucumber-0.5.1 lib/cucumber/ast/features.rb
cucumber-0.5.0 lib/cucumber/ast/features.rb
cucumber-0.4.5.rc2 lib/cucumber/ast/features.rb
kbaum-cucumber-0.4.5.pre lib/cucumber/ast/features.rb
cucumber-0.4.5.rc1 lib/cucumber/ast/features.rb
middleman-0.10.17 vendor/gems/gems/cucumber-0.4.4/lib/cucumber/ast/features.rb
middleman-0.10.16 vendor/gems/gems/cucumber-0.4.4/lib/cucumber/ast/features.rb
middleman-0.10.15 vendor/gems/gems/cucumber-0.4.4/lib/cucumber/ast/features.rb
rackjour-0.1.8 vendor/gems/gems/cucumber-0.4.4/lib/cucumber/ast/features.rb
middleman-0.10.14 vendor/gems/gems/cucumber-0.4.4/lib/cucumber/ast/features.rb
cucumber-0.4.4 lib/cucumber/ast/features.rb