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