Sha256: 9dd7a0631274c31c654a962d3cc221caa9a97f577cbbfa27f9ccf01c8b74d4a6

Contents?: true

Size: 862 Bytes

Versions: 14

Compression:

Stored size: 862 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
        pending_under :java, "requires cucumber/gherkin >= ac42f51" 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
end

Version data entries

14 entries across 12 versions & 5 rubygems

Version Path
candlepin-api-0.4.0 bundle/ruby/gems/cucumber-1.2.1/spec/cucumber/rb_support/regexp_argument_matcher_spec.rb
candlepin-api-0.4.0 bundle/ruby/1.8/gems/cucumber-1.2.1/spec/cucumber/rb_support/regexp_argument_matcher_spec.rb
candlepin-api-0.4.0 bundle/ruby/1.9.1/gems/cucumber-1.2.1/spec/cucumber/rb_support/regexp_argument_matcher_spec.rb
librarian-puppet-0.9.9 vendor/gems/ruby/1.9.1/gems/cucumber-1.2.1/spec/cucumber/rb_support/regexp_argument_matcher_spec.rb
cucumber-1.2.5 spec/cucumber/rb_support/regexp_argument_matcher_spec.rb
cucumber-1.2.3 spec/cucumber/rb_support/regexp_argument_matcher_spec.rb
cucumber-1.2.2 spec/cucumber/rb_support/regexp_argument_matcher_spec.rb
librarian-puppet-0.9.8 vendor/gems/ruby/1.9.1/gems/cucumber-1.2.1/spec/cucumber/rb_support/regexp_argument_matcher_spec.rb
librarian-puppet-0.9.4 vendor/gems/ruby/1.8/gems/cucumber-1.2.1/spec/cucumber/rb_support/regexp_argument_matcher_spec.rb
casecumber-1.2.1.cb2 spec/cucumber/rb_support/regexp_argument_matcher_spec.rb
librarian-puppet-0.9.3 vendor/gems/ruby/1.8/gems/cucumber-1.2.1/spec/cucumber/rb_support/regexp_argument_matcher_spec.rb
cucumber-1.2.1 spec/cucumber/rb_support/regexp_argument_matcher_spec.rb
ftl-0.2.0 vendor/bundle/gems/cucumber-1.2.0/spec/cucumber/rb_support/regexp_argument_matcher_spec.rb
cucumber-1.2.0 spec/cucumber/rb_support/regexp_argument_matcher_spec.rb