Sha256: 743e32321a179c8a4fc429a7c155c0343310b148e5ac78ff0b1d9e589ab3e76d

Contents?: true

Size: 410 Bytes

Versions: 11

Compression:

Stored size: 410 Bytes

Contents

require "rspec"
require "clamp"

Rspec.configure do |config|
  
  config.mock_with :rr

end

module OutputCapture
  
  def self.included(target)

    target.before do
      $stdout = @out = StringIO.new
      $stderr = @err = StringIO.new
    end

    target.after do
      $stdout = STDOUT
      $stderr = STDERR
    end
    
  end

  def stdout
    @out.string
  end

  def stderr
    @err.string
  end

end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
clamp-0.1.8 spec/spec_helper.rb
clamp-0.1.7 spec/spec_helper.rb
clamp-0.1.6 spec/spec_helper.rb
clamp-0.1.5 spec/spec_helper.rb
clamp-0.1.4 spec/spec_helper.rb
clamp-0.1.3 spec/spec_helper.rb
clamp-0.1.2 spec/spec_helper.rb
clamp-0.1.1 spec/spec_helper.rb
clamp-0.1.0 spec/spec_helper.rb
clamp-0.0.9 spec/spec_helper.rb
clamp-0.0.7 spec/spec_helper.rb