Sha256: a41483aa81ceeeb4b56ee01de5036bc7c50f3b24df97426de49cb41f2e870dbc

Contents?: true

Size: 725 Bytes

Versions: 7

Compression:

Stored size: 725 Bytes

Contents

require 'cucumber/cucumber_expressions/expression_factory'

module Cucumber
  module CucumberExpressions
    describe ExpressionFactory do
      before do
        @expression_factory = ExpressionFactory.new(ParameterTypeRegistry.new)
      end

      it 'creates a RegularExpression' do
        expect(@expression_factory.create_expression(/x/).class).to eq(RegularExpression)
      end

      it 'creates a CucumberExpression' do
        expect(@expression_factory.create_expression('{int}').class).to eq(CucumberExpression)
      end

      it 'creates a XXXRegularExpression' do
        expect {@expression_factory.create_expression('hello {x}')}.to raise_error("Undefined parameter type {x}")
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
cucumber-cucumber-expressions-10.3.0 spec/cucumber/cucumber_expressions/expression_factory_spec.rb
cucumber-cucumber-expressions-10.2.2 spec/cucumber/cucumber_expressions/expression_factory_spec.rb
cucumber-cucumber-expressions-10.2.1 spec/cucumber/cucumber_expressions/expression_factory_spec.rb
cucumber-cucumber-expressions-10.2.0 spec/cucumber/cucumber_expressions/expression_factory_spec.rb
cucumber-cucumber-expressions-10.1.0 spec/cucumber/cucumber_expressions/expression_factory_spec.rb
cucumber-cucumber-expressions-10.0.0 spec/cucumber/cucumber_expressions/expression_factory_spec.rb
cucumber-cucumber-expressions-9.0.0 spec/cucumber/cucumber_expressions/expression_factory_spec.rb