Sha256: 7628d79c17a9c42f0937cfa7910f506c65e9372be78448d03a685e04f5df7c3a

Contents?: true

Size: 1.15 KB

Versions: 21

Compression:

Stored size: 1.15 KB

Contents

module Cucumber
  module Formatter
    module LegacyApi

      class Results
        def initialize
          # Optimization - quicker lookup.
          @inserted_steps = {}
          @inserted_scenarios = {}
        end

        def step_visited(step) #:nodoc:
          step_id = step.object_id

          unless @inserted_steps.has_key?(step_id)
            @inserted_steps[step_id] = step
            steps.push(step)
          end
        end

        def scenario_visited(scenario) #:nodoc:
          scenario_id = scenario.object_id

          unless @inserted_scenarios.has_key?(scenario_id)
            @inserted_scenarios[scenario_id] = scenario
            scenarios.push(scenario)
          end
        end

        def steps(status = nil) #:nodoc:
          @steps ||= []
          if(status)
            @steps.select{|step| step.status == status}
          else
            @steps
          end
        end

        def scenarios(status = nil) #:nodoc:
          @scenarios ||= []
          if(status)
            @scenarios.select{|scenario| scenario.status == status}
          else
            @scenarios
          end
        end
      end

    end
  end
end

Version data entries

21 entries across 21 versions & 2 rubygems

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