Sha256: a11159764814cde8bce67354cd28ad7f6faad03e4d6ff626a959e203d79a814b

Contents?: true

Size: 685 Bytes

Versions: 1

Compression:

Stored size: 685 Bytes

Contents

require 'simplecov'
SimpleCov.start do
  add_filter "/spec/"
end

$LOAD_PATH.unshift(File.dirname(__FILE__))
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))

require 'gemline'

RSpec.configure do |c|
  # c.mock_with :rr
end

def stub_rubygems_json_output
  Dir.glob(File.join(File.dirname(__FILE__),'samples', '*.json')).each do |f|
    gem_name = $1 if f =~ /\/([\w\-]+).json$/
    allow(Gemline).to receive(:get_rubygem_json).with(gem_name).and_return(IO.read(f))
  end
end

def grab_io
  @stdout = StringIO.new; $stdout = @stdout;
  @stderr = StringIO.new; $stderr = @stderr;

  yield

  @stdout.rewind; @stderr.rewind;

  $stdout = STDOUT
  $stderr = STDERR
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
gemline-0.4.5 spec/spec_helper.rb