From 896da4f7fd026b5927cf104b490db757431bcef5 Mon Sep 17 00:00:00 2001 From: Laurent Sansonetti Date: Wed, 15 Oct 2014 16:16:19 +0200 Subject: [PATCH] when running specs on the device, redirect puts/print calls to NSLog --- lib/motion/spec.rb | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/lib/motion/spec.rb b/lib/motion/spec.rb index b60c6a9f..555b7025 100644 --- a/lib/motion/spec.rb +++ b/lib/motion/spec.rb @@ -726,3 +726,14 @@ end # Do not log all exceptions when running the specs. Exception.log_exceptions = false + +unless UIDevice.currentDevice.model.match(/simulator/i) + module Kernel + def puts(*args) + NSLog(args.join("\n")) + end + def print(*args) + puts *args # TODO + end + end +end