Sha256: c86f68f6a35cf99982ff158d25d5127cc552138017c709e3bdd934441d889f43

Contents?: true

Size: 785 Bytes

Versions: 8

Compression:

Stored size: 785 Bytes

Contents

require 'rspec'

if RUBY_VERSION < '1.9'
  require 'rspec/autorun'
else
  require 'simplecov'
  if defined?( GATHER_RSPEC_COVERAGE )
    SimpleCov.start do
      add_filter "/spec/"
      add_filter "/vendor/"
    end
  end
end

require File.expand_path( File.dirname(__FILE__) + '/../lib/imap/backup' )

module HighLineTestHelpers

  def prepare_highline
    @input  = stub('stdin', :eof? => false)
    # default gets stub
    @input.stub!(:gets).with().and_return("q\n")
    @output = StringIO.new
    Imap::Backup::Configuration::Setup.highline = HighLine.new(@input, @output)
    [@input, @output]
  end

end

module InputOutputTestHelpers

  def capturing_output
    output = StringIO.new
    $stdout = output
    yield
    output.string
  ensure
    $stdout = STDOUT
  end

end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
imap-backup-1.0.5 spec/spec_helper.rb
imap-backup-1.0.4 spec/spec_helper.rb
imap-backup-1.0.3 spec/spec_helper.rb
imap-backup-1.0.2 spec/spec_helper.rb
imap-backup-1.0.1 spec/spec_helper.rb
imap-backup-1.0.0 spec/spec_helper.rb
imap-backup-0.0.5 spec/spec_helper.rb
imap-backup-0.0.4 spec/spec_helper.rb