Sha256: ac38b7306a30622dd2ed8a0b44e15bb768fb666fa9a549b8f3a053c363b69ea9

Contents?: true

Size: 597 Bytes

Versions: 9

Compression:

Stored size: 597 Bytes

Contents

require 'bundler/setup'
Bundler.require

require 'webmock/rspec'
require 'pathname'
require 'stringio'

RSpec.configure do |config|
  def capture(stream)
    begin
      stream = stream.to_s
      eval "$#{stream} = StringIO.new"
      yield
      result = eval("$#{stream}").string
    ensure
      eval("$#{stream} = #{stream.upcase}")
    end

    result
  end

  def base_dir
    Pathname('../..').expand_path(__FILE__)
  end

  def tmp_dir
    base_dir.join('tmp')
  end

  alias :silence :capture

  config.before(:all) do
    unless tmp_dir.directory?
      tmp_dir.mkdir
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
ec2ssh-2.0.8 spec/spec_helper.rb
ec2ssh-2.0.7 spec/spec_helper.rb
ec2ssh-2.0.6 spec/spec_helper.rb
ec2ssh-2.0.5 spec/spec_helper.rb
ec2ssh-2.0.4 spec/spec_helper.rb
ec2ssh-2.0.3 spec/spec_helper.rb
ec2ssh-2.0.2 spec/spec_helper.rb
ec2ssh-2.0.1 spec/spec_helper.rb
ec2ssh-2.0.0 spec/spec_helper.rb