UIAlertViewを初期化した変数をインスタンス変数にして、
controller.instance_variable_get("@alert_box")ってやってるだけ
gesture_controller.rbの一部
def show_alert(message)
@alert_box = UIAlertView.alloc.initWithTitle("Gesture Action",
message:message,
delegate:nil,
cancelButtonTitle:"ok",
otherButtonTitles:nil)
@alert_box.show
end
describe GestureController do tests GestureController it "tap" do tap 'view 1' controller.instance_variable_get("@alert_box").message.should == "You've tapped the screen!" end end