File: tests_helper.rb

package info (click to toggle)
ruby-formatador 1.2.3-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 156 kB
  • sloc: ruby: 477; sh: 4; makefile: 2
file content (27 lines) | stat: -rw-r--r-- 421 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
$LOAD_PATH.unshift(File.dirname(__FILE__))
require 'formatador'
require 'rubygems'
require 'shindo'
require 'stringio'

class IO
  def tty?
    true
  end
end

class StringIO
  def tty?
    true
  end
end

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