Sha256: 155f366220da2454a106795d414034597bf54e30372e6c4b828c27be0eb42a18

Contents?: true

Size: 419 Bytes

Versions: 10

Compression:

Stored size: 419 Bytes

Contents

module SpecUtils
  def capture_stderr(&block)
    original_stderr = $stderr
    $stderr = fake = StringIO.new
    begin
      yield
    ensure
      $stderr = original_stderr
    end
    fake.string
  end

  def capture_stdout(&block)
    original_stdout = $stdout
    $stdout = fake = StringIO.new
    begin
      yield
    ensure
      $stdout = original_stdout
    end
    fake.string
  end
end

Version data entries

10 entries across 10 versions & 2 rubygems

Version Path
messages_dictionary-1.0.0 spec/support/spec_utils.rb
messages_dictionary-0.1.3.2 spec/support/spec_utils.rb
messages_dictionary-0.1.3.1 spec/support/spec_utils.rb
messages_dictionary-0.1.3 spec/support/spec_utils.rb
messages_dictionary-0.1.2 spec/support/spec_utils.rb
messages_dictionary-0.1.1 spec/support/spec_utils.rb
messages_dictionary-0.0.2 spec/support/spec_utils.rb
messages_dictionary-0.0.1 spec/support/spec_utils.rb
lessons_indexer-0.0.2.2 spec/support/spec_utils.rb
lessons_indexer-0.0.2.1 spec/support/spec_utils.rb