spec/spec_helper.rb in taza-2.1.0 vs spec/spec_helper.rb in taza-3.0.0

- old
+ new

@@ -20,19 +20,18 @@ config.after(:each) do Dir.chdir(@original_directory) FileUtils.rmtree(@directory) end - def capture(stream) + def capture_stdout begin - stream = stream.to_s - eval "$#{stream} = StringIO.new" + $stdout = StringIO.new yield - result = eval("$#{stream}").string + out = $stdout.string ensure - eval("$#{stream} = #{stream.upcase}") + $stdout = STDOUT end - result + out end end def null_device File.exists?('/dev/null') ? '/dev/null' : 'NUL'