spec/spec_helper.rb in igp-0.0.3 vs spec/spec_helper.rb in igp-1.0.0
- old
+ new
@@ -1,14 +1,14 @@
require 'igp'
require 'stringio'
def capture(*streams)
- streams.map! { |stream| stream.to_s }
+ streams.map!(&:to_s)
begin
result = StringIO.new
- streams.each { |stream| eval "$#{stream} = result" }
+ streams.each { |stream| eval "$#{stream} = result # $#{stream} = result" }
yield
ensure
- streams.each { |stream| eval("$#{stream} = #{stream.upcase}") }
+ streams.each { |stream| eval("$#{stream} = #{stream.upcase} # $#{stream} = #{stream.upcase}") }
end
result.string
-end
\ No newline at end of file
+end