File: tests_helper.rb

package info (click to toggle)
ruby-formatador 0.2.1-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 96 kB
  • sloc: ruby: 299; makefile: 2
file content (14 lines) | stat: -rw-r--r-- 316 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
$LOAD_PATH.unshift(File.dirname(__FILE__))
require 'formatador'
require 'rubygems'
require 'shindo'

def capture_stdout
  old_stdout = $stdout
  new_stdout = StringIO.new
  $stdout = new_stdout
  yield
  $stdout = old_stdout
  new_stdout.string
end