Sha256: 1d16807b9685a024928184dd1fb5646749277ac76c7d0e79f65b2b8e192c2d18

Contents?: true

Size: 820 Bytes

Versions: 12

Compression:

Stored size: 820 Bytes

Contents

require 'rubygems'
require 'bundler/setup'
require 'webmock/rspec'
require 'rspec/mocks'
RSpec::Mocks::setup(Object.new)

require 'socialcast/cli'

RSpec.configure do |config|
  config.mock_with :rspec

  def capture_with_status(stream)
    exit_status = 0
    begin
      stream = stream.to_s
      eval "$#{stream} = StringIO.new"
      begin
        yield
      rescue SystemExit => system_exit # catch any exit calls
        exit_status = system_exit.status
      end
      result = eval("$#{stream}").string
    ensure
      eval("$#{stream} = #{stream.upcase}")
    end
    return result, exit_status
  end

  def remove_directories(*names)
    project_dir = Pathname.new(Dir.pwd)
    names.each do |name|
      FileUtils.rm_rf(project_dir.join(name)) if FileTest.exists?(project_dir.join(name))
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
socialcast-1.2.3 spec/spec_helper.rb
socialcast-1.2.2 spec/spec_helper.rb
socialcast-1.2.1.RC1 spec/spec_helper.rb
socialcast-1.2.0 spec/spec_helper.rb
socialcast-1.1.6 spec/spec_helper.rb
socialcast-1.1.5 spec/spec_helper.rb
socialcast-1.1.4 spec/spec_helper.rb
socialcast-1.1.3 spec/spec_helper.rb
socialcast-1.1.2 spec/spec_helper.rb
socialcast-1.1.1 spec/spec_helper.rb
socialcast-1.1.0 spec/spec_helper.rb
socialcast-1.0.8 spec/spec_helper.rb