Sha256: d23a07e485051a29cfebd39b2b10278f99d7ecf1a3ad7f10c342b070b43d4b43

Contents?: true

Size: 1.2 KB

Versions: 2

Compression:

Stored size: 1.2 KB

Contents

# encoding: utf-8
#--
#   Copyright (C) 2012 Gitorious AS
#
#   This program is free software: you can redistribute it and/or modify
#   it under the terms of the GNU Affero General Public License as published by
#   the Free Software Foundation, either version 3 of the License, or
#   (at your option) any later version.
#
#   This program is distributed in the hope that it will be useful,
#   but WITHOUT ANY WARRANTY; without even the implied warranty of
#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#   GNU Affero General Public License for more details.
#
#   You should have received a copy of the GNU Affero General Public License
#   along with this program.  If not, see <http://www.gnu.org/licenses/>.
#++
require "bundler/setup"
require "minitest/autorun"
require "em/minitest/spec"
require "eventmachine"

Bundler.require(:default, :test)

module Dolt
  module StdioStub
    def silence_stderr
      new_stderr = $stderr.dup
      rd, wr = IO::pipe
      $stderr.reopen(wr)
      yield
      $stderr.reopen(new_stderr)
    end

    def silence_stdout
      new_stdout = $stdout.dup
      rd, wr = IO::pipe
      $stdout.reopen(wr)
      yield
      $stdout.reopen(new_stdout)
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
dolt-0.1.1 ./test/test_helper.rb
dolt-0.1.0 ./test/test_helper.rb