Permalink
Browse files

Merge branch 'some_step_tweaks' of https://github.com/JonRowe/CukeSalad

… into some_step_tweaks
  • Loading branch information...
2 parents e847546 + 9ef0f44 commit 4a6272acef5ad6701d9c762f4800a99aa0903db3 @antonymarcano antonymarcano committed Sep 11, 2011
@@ -28,3 +28,11 @@ Feature: Define the Role
Given I am a New Customer
"""
Then you should see it has 'passed'
+
+ Scenario: Roles which grammatically required an 'an'
+ Given you did create a role: called 'UnregisteredCustomer'
+ When you attempt to run a scenario: containing
+ """
+ Given I am an Unregistered Customer
+ """
+ Then you should see it has 'passed'
@@ -52,3 +52,31 @@ Feature: Define a Task
| And I should do something |
| Then you should do something |
| And you should do something |
+
+ Scenario Outline: Once you've created the task, you see the step pass
+ Given you were able to create a task: called 'do something for 123Company'
+ When you attempt to run a scenario: containing
+ """
+ Given I am a New Customer
+ <step using the task>
+ """
+ Then you should see it has 'passed'
+
+ Examples:
+ | step using the task |
+ | Given I was able to do something for 123Company |
+ | And I was able to do something for 123Company |
+ | But I did do something for 123Company |
+ | Given you were able to do something for 123Company |
+ | And you were able to do something for 123Company |
+ | But you did do something for 123Company |
+ | When I attempt to do something for 123Company |
+ | And I attempt to do something for 123Company |
+ | And I did do something for 123Company |
+ | When you attempt to do something for 123Company |
+ | And you attempt to do something for 123Company |
+ | And you did do something for 123Company |
+ | Then I should do something for 123Company |
+ | And I should do something for 123Company |
+ | Then you should do something for 123Company |
+ | And you should do something for 123Company |
@@ -11,11 +11,11 @@ def in_order_to(do_something, *with_attributes, &actions)
puts "CukeSalad says: Hello!!"
end
-Given /^(?:I am|you are) a ([a-zA-Z ]+)$/ do |role|
+Given /^(?:I am|you are) a(?:n)? ([a-zA-Z ]+)$/ do |role|
@actor = CukeSalad::Actor.new(role)
end
-When /^(?:I|you) (?:attempt to|was able to|were able to|did)? ([A-Z a-z_-]*)(?:[:|,] (.*))?:?$/ do | this_task, details, *and_more |
+When /^(?:I|you) (?:attempt to|was able to|were able to|did)? ([A-Z a-z\d_-]*)(?:[:|,] (.*))?:?$/ do | this_task, details, *and_more |
info = understand_the details unless details.nil?
info[info.keys.last] = and_more[0] unless and_more.empty?
@actor.perform this_task, info unless info.nil?

0 comments on commit 4a6272a

Please sign in to comment.