Sha256: 6b59da89fa41ce44a02b65b46621a311982591daa57ceec4c07a2b1fff53fd9f

Contents?: true

Size: 673 Bytes

Versions: 2

Compression:

Stored size: 673 Bytes

Contents

# Capturing the stdout
# Need to rescue SystemExit
# https://github.com/cldwalker/hirb/blob/master/test/test_helper.rb
def capture_stdout(&block)
  original_stdout = $stdout
  fake_stdout = StringIO.new
  $stdout = fake_stdout
  begin
    yield
  rescue SystemExit
  ensure
    $stdout = original_stdout
  end
  return fake_stdout.string
end

# for hiding the stdout from tests
def hide_stdout(&block)
  original_stdout = $stdout
  fake_stdout = StringIO.new
  $stdout = fake_stdout
  begin
    yield
  ensure
    $stdout = original_stdout
  end
end

# Disable "should" syntax.
RSpec.configure do |config|
  config.expect_with :rspec do |c|
    c.syntax = :expect
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
snapdragon-3.0.0 spec/spec_helper.rb
snapdragon-2.0.0 spec/spec_helper.rb