larrytheliquid
15p11 comments posted · 0 followers · following 0
120 weeks ago @ larrλtheliquid ... - Intro to Proofs-as-Pro... · 0 replies · +1 points
+1
120 weeks ago @ larrλtheliquid ... - Intro to Proofs-as-Pro... · 0 replies · +1 points
120 weeks ago @ larrλtheliquid ... - Intro to Proofs-as-Pro... · 5 replies · +1 points
120 weeks ago @ larrλtheliquid ... - Intro to Proofs-as-Pro... · 0 replies · +1 points
121 weeks ago @ larrλtheliquid ... - Roadmap · 0 replies · +1 points
124 weeks ago @ Union Station - Cucumber: Step Argumen... · 0 replies · +1 points
http://gist.github.com/191691
124 weeks ago @ Union Station - Cucumber: Step Argumen... · 0 replies · +1 points
124 weeks ago @ Union Station - Cucumber: Step Argumen... · 0 replies · +1 points
I'm not sure if I understand your situation exactly, let me know if this solves it:
# support file
Transform /^new young child (\w+)$ do |first_name|
Person.gen(:child, :first_name => first_name)
end
Transform /^new guest user (\w+)$/ do |username|
User.gen(:guest, :username => username)
end
Transform /^person (\w+)$/ do |first_name|
Person.first :first_name => first_name
end
Transform /^user (\w+)$/ do |username|
User.first :username => username
end
# step definition file
Given /^a (\w+) added by (\w+)$/ do | person, user |
user.add person
end
Then /^(user \w+) has a referral for (person \w+)$/ do |user, person |
user.should have_referral_for(person)
end
# feature file
Given a new young child Mike added by new guest user coolio
Then user coolio has a referral for person Mike
125 weeks ago @ Union Station - Cucumber: Step Argumen... · 0 replies · +1 points
125 weeks ago @ Union Station - Cucumber: Step Argumen... · 0 replies · +1 points
Transform /^age (\d+)$/ do |age_string|
age_string.to_i
end
Transform /^user (\w+)$/ do |username|
User.first :username => username
end
Also, as of Cucumber 0.3.101 step argument transforms are in the official release!
Production