Sha256: 3823b9649dd9e5d42d13bc0dc1b41ce4e20e713d035be3f34e6acc8e74a93d9c

Contents?: true

Size: 738 Bytes

Versions: 15

Compression:

Stored size: 738 Bytes

Contents

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

module Cucumber
  module RbSupport
    describe RegexpArgumentMatcher do
      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

15 entries across 15 versions & 4 rubygems

Version Path
resque-pool-0.3.0 vendor/bundle/ruby/1.8/gems/cucumber-1.1.9/spec/cucumber/rb_support/regexp_argument_matcher_spec.rb
frameworks-capybara-0.2.0.rc6 vendor/bundle/ruby/1.8/gems/cucumber-1.1.9/spec/cucumber/rb_support/regexp_argument_matcher_spec.rb
frameworks-capybara-0.2.0.rc5 vendor/bundle/ruby/1.8/gems/cucumber-1.1.9/spec/cucumber/rb_support/regexp_argument_matcher_spec.rb
frameworks-capybara-0.2.0.rc4 vendor/bundle/ruby/1.8/gems/cucumber-1.1.9/spec/cucumber/rb_support/regexp_argument_matcher_spec.rb
frameworks-capybara-0.2.0.rc3 vendor/bundle/ruby/1.8/gems/cucumber-1.1.9/spec/cucumber/rb_support/regexp_argument_matcher_spec.rb
frameworks-capybara-0.2.0.rc2 vendor/bundle/ruby/1.8/gems/cucumber-1.1.9/spec/cucumber/rb_support/regexp_argument_matcher_spec.rb
resque-pool-0.3.0.beta.2 vendor/bundle/ruby/1.8/gems/cucumber-1.1.9/spec/cucumber/rb_support/regexp_argument_matcher_spec.rb
radiant-1.0.0 ruby-debug/ruby/1.8/gems/cucumber-1.1.9/spec/cucumber/rb_support/regexp_argument_matcher_spec.rb
cucumber-1.1.9 spec/cucumber/rb_support/regexp_argument_matcher_spec.rb
cucumber-1.1.8 spec/cucumber/rb_support/regexp_argument_matcher_spec.rb
cucumber-1.1.7 spec/cucumber/rb_support/regexp_argument_matcher_spec.rb
cucumber-1.1.6 spec/cucumber/rb_support/regexp_argument_matcher_spec.rb
cucumber-1.1.5 spec/cucumber/rb_support/regexp_argument_matcher_spec.rb
cucumber-1.1.4 spec/cucumber/rb_support/regexp_argument_matcher_spec.rb
cucumber-1.1.3 spec/cucumber/rb_support/regexp_argument_matcher_spec.rb