example/step_definitions/example.step.rb in cucumber-in-the-yard-1.5.2 vs example/step_definitions/example.step.rb in cucumber-in-the-yard-1.5.3

- old
+ new

@@ -1,7 +1,5 @@ - - CUSTOMER = /(?:(?:an?|the) customer|#{TEDDY_BEAR})/ TEDDY_BEAR = /teddy bear/ Transform /^an? customer$/ do |customer| @@ -46,9 +44,30 @@ end And /^edits their the (biography) to state:$/ do |section,text| pending "text_field not present for #{section} #{bio} for this release" end + +# +# Complicated step definition with optional parameters +# +Given /^(?:I create )?an? (?:(active|deactive|inactive|simulated)d?)? ?project(?:[\s,]*(?:with)? ?(?:an?|the)? (?:(?:the size? (?:at|of)? ?(\d+)|named? (?:of )?'([^']+)'|start date (?:of )?((?:(?:\d{1,2}[\/-]){2}(?:\d\d){1,2}))|end date (?:of )?((?:(?:\d{1,2}[\/-]){2}(?:\d\d){1,2}))|user range (?:of )?(\d+-\d+)|description (?:of )?'([^']+)'|nicknamed? (?:of )?'([^']+)')[,\s]*)* ?)?$/ do |state,size,name,start_date,end_date,user_range,description,nickname| + pending "#{state} #{size} #{name} #{start_date} #{end_date} #{user_range} #{description} #{nickname}" +end + + +# +# The highlighting replacement uses a span which had trouble when blindly using +# a gsub replacement. +# +Given /(a|\d+) ducks? that ha(?:s|ve) (a|\d+) bills?/ do |duck_count,bills_count| + pending +end + +Then /I expect the (duck|bird) to (\w+)/ do |animal,verb| + pending +end + # # Some details about the helper method that might be picked up in the documentation. # def a_helper_method \ No newline at end of file