Sha256: f3e84524e7101f802e5388f7024b7fda0a236046f1980a676d74cd081830e781

Contents?: true

Size: 1.3 KB

Versions: 1

Compression:

Stored size: 1.3 KB

Contents

require 'spec_helper'

SimpleCov.command_name('World') unless RUBY_VERSION.to_s < '1.9.0'

describe 'World, Integration' do

  before(:each) do
    @world = CucumberAnalytics::World
    @world.loaded_step_patterns.clear
  end

  context 'collecting stuff' do

    before(:each) do
      @patterns = [/a defined step/, /another defined step/]
      @defined_steps = [CucumberAnalytics::Step.new('* a defined step'), CucumberAnalytics::Step.new('* another defined step')]
      @undefined_steps = [CucumberAnalytics::Step.new('* an undefined step'), CucumberAnalytics::Step.new('* another undefined step')]

      @patterns.each do |pattern|
        @world.load_step_pattern(pattern)
      end
    end

    it 'can collect defined steps from containers' do
      nested_container = double(:steps => @defined_steps)
      container = double(:steps => @undefined_steps, :contains => [nested_container])

      expect(@defined_steps).to match_array(@world.defined_steps_in(container))
    end

    it 'can collect undefined steps from containers' do
      nested_container = double(:steps => @defined_steps)
      container = double(:steps => @undefined_steps, :contains => [nested_container])

      expect(@undefined_steps).to match_array(@world.undefined_steps_in(container))
    end

  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
cucumber_analytics-1.5.2 spec/integration/world_integration_spec.rb