Skip to content

Instantly share code, notes, and snippets.

@Watson1978
Created May 8, 2012 12:17
Show Gist options
  • Select an option

  • Save Watson1978/2634522 to your computer and use it in GitHub Desktop.

Select an option

Save Watson1978/2634522 to your computer and use it in GitHub Desktop.
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