spec/spec_helper.rb in pebbles-lovelive-0.0.2 vs spec/spec_helper.rb in pebbles-lovelive-0.1.0
- old
+ new
@@ -7,5 +7,16 @@
Coveralls::SimpleCov::Formatter
]
$LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
require 'pebbles/lovelive'
+
+def capture_stdout(&block)
+ original_stdout = $stdout
+ $stdout = fake = StringIO.new
+ begin
+ yield
+ ensure
+ $stdout = original_stdout
+ end
+ fake.string
+end