Created
May 8, 2012 12:17
-
-
Save Watson1978/2634522 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
| describe "Application 'StopWatch'" do | |
| before do | |
| @app = UIApplication.sharedApplication | |
| @controller = @app.windows.first.rootViewController | |
| end | |
| it "has one window" do | |
| @app.windows.size.should == 1 | |
| end | |
| it "should have a label" do | |
| label = @controller.instance_variable_get(:@label) | |
| label.should != nil | |
| end | |
| it "should start a timer" do | |
| @app.sendAction("startTimer:", to: @controller, from: self, forEvent: nil) | |
| timer = @controller.instance_variable_get(:@timer) | |
| timer.should != nil | |
| end | |
| it "should stop a timer" do | |
| @app.sendAction("startTimer:", to: @controller, from: self, forEvent: nil) | |
| @app.sendAction("stopTimer:", to: @controller, from: self, forEvent: nil) | |
| timer = @controller.instance_variable_get(:@timer) | |
| timer.should == nil | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment