Sha256: 7a570318d9545066c313c651c5436d3fc1a3f1a4904240b9b774e9234ae50053

Contents?: true

Size: 775 Bytes

Versions: 24

Compression:

Stored size: 775 Bytes

Contents

require 'spec_helper'
require 'cucumber/rb_support/regexp_argument_matcher'

module Cucumber
  module RbSupport
    describe RegexpArgumentMatcher do
      include RSpec::WorkInProgress

      it "should create 2 arguments" do
        arguments = RegexpArgumentMatcher.arguments_from(/I (\w+) (\w+)/, "I like fish")
        arguments.map{|argument| [argument.val, argument.offset]}.should == [["like", 2], ["fish", 7]]
      end

      it "should create 2 arguments when first group is optional" do
        arguments = RegexpArgumentMatcher.arguments_from(/should( not)? be flashed '([^']*?)'$/, "I should be flashed 'Login failed.'")
        arguments.map{|argument| [argument.val, argument.offset]}.should == [[nil, nil], ["Login failed.", 21]]
      end
    end
  end
end

Version data entries

24 entries across 22 versions & 2 rubygems

Version Path
honeybadger-2.4.0 vendor/gems/ruby/2.2.0/gems/cucumber-1.3.18/spec/cucumber/rb_support/regexp_argument_matcher_spec.rb
honeybadger-2.4.0 vendor/gems/ruby/2.1.0/gems/cucumber-1.3.16/spec/cucumber/rb_support/regexp_argument_matcher_spec.rb
honeybadger-2.4.0 vendor/gems/ruby/1.9.1/gems/cucumber-1.3.18/spec/cucumber/rb_support/regexp_argument_matcher_spec.rb
cucumber-1.3.20 spec/cucumber/rb_support/regexp_argument_matcher_spec.rb
cucumber-1.3.19 spec/cucumber/rb_support/regexp_argument_matcher_spec.rb
cucumber-1.3.18 spec/cucumber/rb_support/regexp_argument_matcher_spec.rb
cucumber-1.3.17 spec/cucumber/rb_support/regexp_argument_matcher_spec.rb
cucumber-1.3.16 spec/cucumber/rb_support/regexp_argument_matcher_spec.rb
cucumber-1.3.15 spec/cucumber/rb_support/regexp_argument_matcher_spec.rb
cucumber-1.3.14 spec/cucumber/rb_support/regexp_argument_matcher_spec.rb
cucumber-1.3.13 spec/cucumber/rb_support/regexp_argument_matcher_spec.rb
cucumber-1.3.12 spec/cucumber/rb_support/regexp_argument_matcher_spec.rb
cucumber-1.3.11 spec/cucumber/rb_support/regexp_argument_matcher_spec.rb
cucumber-1.3.10 spec/cucumber/rb_support/regexp_argument_matcher_spec.rb
cucumber-1.3.9 spec/cucumber/rb_support/regexp_argument_matcher_spec.rb
cucumber-1.3.8 spec/cucumber/rb_support/regexp_argument_matcher_spec.rb
cucumber-1.3.7 spec/cucumber/rb_support/regexp_argument_matcher_spec.rb
cucumber-1.3.6 spec/cucumber/rb_support/regexp_argument_matcher_spec.rb
cucumber-1.3.5 spec/cucumber/rb_support/regexp_argument_matcher_spec.rb
cucumber-1.3.4 spec/cucumber/rb_support/regexp_argument_matcher_spec.rb