Sha256: efe8af56988916cce7ec50503587948aeba9802766867177d58ba3488fc82605

Contents?: true

Size: 1.33 KB

Versions: 1

Compression:

Stored size: 1.33 KB

Contents

require "#{File.dirname(__FILE__)}/../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.6.0 testing/rspec/spec/integration/world_integration_spec.rb