Sha256: 12499d1865ebd1b0fa54ce4de679b0f17ae1828ea2ea288f2f59cd79faaa2aac

Contents?: true

Size: 1.31 KB

Versions: 21

Compression:

Stored size: 1.31 KB

Contents

SPEC_ROOT = File.dirname(__FILE__).freeze

require "rspec"
require "cfoundry"
require "cfoundry/test_support"
require "cf"
require "cf/test_support"
require "webmock"
require "webmock/rspec"
require "ostruct"
require "fakefs/safe"
require "blue-shell"

Dir.glob("support/mock_commands/*").each { |f| require f }

TRAVIS_BUILD_ID = ENV["TRAVIS_BUILD_ID"]

OriginalFile = File

class FakeFS::File
  def self.fnmatch(*args, &blk)
    OriginalFile.fnmatch(*args, &blk)
  end
end

def cf_bin
  File.expand_path("#{SPEC_ROOT}/../bin/cf.dev")
end

Dir[File.expand_path('../support/**/*.rb', __FILE__)].each do |file|
  require file
end

RSpec.configure do |c|
  c.include BlueShell::Matchers

  if RUBY_VERSION =~ /^1\.8\.\d/
    c.filter_run_excluding :ruby19 => true
  end

  c.include FakeHomeDir
  c.include CliHelper
  c.include InteractHelper
  c.include ConfigHelper
  c.include FeaturesHelper

  c.before(:all) do
    WebMock.disable_net_connect!(:allow_localhost => true)
  end

  c.before do
    CF::CLI.send(:class_variable_set, :@@client, nil)
  end

  c.after do
    if example.exception != nil && example.exception.message.include?("~/.cf/crash")
      puts '~/.cf/crash output for failed spec:'
      puts `cat ~/.cf/crash`
    end
  end
end

def name_list(xs)
  if xs.empty?
    "none"
  else
    xs.collect(&:name).join(", ")
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
cf-5.4.5 spec/spec_helper.rb
cf-5.4.4 spec/spec_helper.rb
cf-5.4.3 spec/spec_helper.rb
cf-5.4.2 spec/spec_helper.rb
cf-5.4.1 spec/spec_helper.rb
cf-5.4.1.rc1 spec/spec_helper.rb
cf-5.4.0 spec/spec_helper.rb
cf-5.3.1 spec/spec_helper.rb
cf-5.3.0 spec/spec_helper.rb
cf-5.2.2 spec/spec_helper.rb
cf-5.2.1.rc15 spec/spec_helper.rb
cf-5.2.1.rc14 spec/spec_helper.rb
cf-5.2.1.rc13 spec/spec_helper.rb
cf-5.2.1.rc12 spec/spec_helper.rb
cf-5.2.1.rc11 spec/spec_helper.rb
cf-5.2.1.rc10 spec/spec_helper.rb
cf-5.2.1.rc9 spec/spec_helper.rb
cf-5.2.1.rc8 spec/spec_helper.rb
cf-5.2.1.rc7 spec/spec_helper.rb
cf-5.2.1.rc6 spec/spec_helper.rb