Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 30 lines (25 sloc) 0.434 kB
ad63d7c Initial import
Jakub Stastny aka Botanicus authored
1 # encoding: utf-8
2
3 begin
4 require "spec"
5 rescue LoadError
6 abort "You have to install rspec gem!"
7 end
8
9 require "stringio"
10
11 def STDOUT.capture(&block)
12 before = self
13 $stdout = StringIO.new
14 block.call
15 $stdout.rewind
16 output = $stdout.read
17 $stdout = before
18 output
19 end
caab883 Added some features
Jakub Stastny aka Botanicus authored
20
21 def STDERR.capture(&block)
22 before = self
23 $stderr = StringIO.new
24 block.call
25 $stderr.rewind
26 output = $stderr.read
27 $stderr = before
28 output
29 end
Something went wrong with that request. Please try again.