Sha256: 3ef98c90d4e3e1c969753b1980cac1a983b0a56210f6c85fd0b029d30a4b9cf3
Contents?: true
Size: 673 Bytes
Versions: 3
Compression:
Stored size: 673 Bytes
Contents
# frozen_string_literal: true require 'spec_helper' require 'cucumber/step_argument' module Cucumber describe StepArgument do it 'creates 2 arguments' do arguments = StepArgument.arguments_from(/I (\w+) (\w+)/, 'I like fish') expect(arguments.map{|argument| [argument.val, argument.offset]}).to eq [['like', 2], ['fish', 7]] end it 'creates 2 arguments when first group is optional' do arguments = StepArgument.arguments_from(/should( not)? be flashed '([^']*?)'$/, "I should be flashed 'Login failed.'") expect(arguments.map{|argument| [argument.val, argument.offset]}).to eq [[nil, nil], ['Login failed.', 21]] end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
cucumber-3.0.1 | spec/cucumber/step_argument_spec.rb |
cucumber-3.0.0 | spec/cucumber/step_argument_spec.rb |
cucumber-3.0.0.pre.2 | spec/cucumber/step_argument_spec.rb |