Sha256: 6d83dd28cc4f49bb798c3ef30a374ee38689478d341d71978c4575c627cd65ba

Contents?: true

Size: 1005 Bytes

Versions: 8

Compression:

Stored size: 1005 Bytes

Contents

require 'spec_helper'

require_relative 'cucumber_helper'

require 'cucumber'
require 'cucumber/rb_support/rb_language'

describe Cucumber::Runtime, 'extended with cucumber_factory' do

  before(:each) do
    prepare_cucumber_example
  end

  describe 'step_match' do

    it "should not raise an ambiguous step error and match the user step if the only other matching step is a factory step" do
      user_step = @main.Given(/^there is a movie with a funny tone/){}
      match = @runtime.step_match('there is a movie with a funny tone')
      match.step_definition.should == user_step
      match.should be_a(Cucumber::StepMatch)
    end

    it "should still raise an ambiguous step error if more than two non-factory steps match" do
      @main.Given(/^there is a movie with (.*?) tone/){}
      @main.Given(/^there is a movie with a funny tone/){}
      expect do
        @runtime.step_match('there is a movie with a funny tone')
      end.to raise_error(Cucumber::Ambiguous)
    end
    
  end

end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
cucumber_factory-1.11.4 spec/shared/cucumber_factory/runtime_ext_spec.rb
cucumber_factory-1.11.3 spec/shared/cucumber_factory/runtime_ext_spec.rb
cucumber_factory-1.11.2 spec/shared/cucumber_factory/runtime_ext_spec.rb
cucumber_factory-1.11.1 spec/shared/cucumber_factory/runtime_ext_spec.rb
cucumber_factory-1.11.0 spec/shared/cucumber_factory/runtime_ext_spec.rb
cucumber_factory-1.10.0 spec/shared/cucumber_factory/runtime_ext_spec.rb
cucumber_factory-1.9.2 spec/shared/cucumber_factory/runtime_ext_spec.rb
cucumber_factory-1.9.1 spec/shared/cucumber_factory/runtime_ext_spec.rb