Created
March 2, 2010 09:52
-
-
Save hammerdr/319405 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Feature: MyButton shows up | |
| In order to satisfy Bob | |
| As a awesome dude | |
| I want to show him MyButton | |
| Scenario: MyButton shows on load | |
| Then MyButton should display |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @import "Then.j" | |
| var shouldDisplayRegex = /(.*) should display/; | |
| @implementation ShouldDisplay : Then | |
| - (BOOL)matches:(CPString)input | |
| { | |
| return input.match(shouldDisplayRegex); | |
| } | |
| - (void)parse:(CPString)lineData context:(CPDictionary)context delegate:(UITestScript)delegate | |
| { | |
| var tag = lineData.match(shouldDisplayRegex)[1]; | |
| var view = [self findViewByTag:tag]; | |
| if(view) | |
| { | |
| [self succeed:delegate]; | |
| } | |
| else | |
| { | |
| [self failure:delegate]; | |
| } | |
| } | |
| @end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment