Sha256: 0e241e7dff2f970f02c0a9bab0e4b3fd436704cb6eff7cbd52a30527e46017b5

Contents?: true

Size: 1.74 KB

Versions: 17

Compression:

Stored size: 1.74 KB

Contents

if self.class.const_defined?(:EY_ROOT)
  raise "don't require the spec helper twice!"
end

if ENV['COVERAGE']
  require 'simplecov'
  SimpleCov.start
end

EY_ROOT = File.expand_path("../..", __FILE__)
require 'rubygems'
require 'bundler/setup'
require 'escape'
require 'net/ssh'

# Bundled gems
require 'fakeweb'
require 'fakeweb_matcher'

require 'multi_json'

# Engineyard gem
$LOAD_PATH.unshift(File.join(EY_ROOT, "lib"))
require 'engineyard'

require 'engineyard-cloud-client/test'

# Spec stuff
require 'rspec'
require 'tmpdir'
require 'yaml'
require 'pp'

Dir[File.join(EY_ROOT,'/spec/support/*.rb')].each do |helper|
  require helper
end

TMPDIR = Pathname.new(__FILE__).dirname.parent.join('tmp')

RSpec.configure do |config|
  config.treat_symbols_as_metadata_keys_with_true_values = true
  config.run_all_when_everything_filtered = true

  config.include SpecHelpers
  config.include SpecHelpers::IntegrationHelpers

  config.extend SpecHelpers::GitRepoHelpers
  config.extend SpecHelpers::Given

  def clean_tmpdir
    TMPDIR.rmtree if TMPDIR.exist?
  end

  # Cleaning the tmpdir has to happen outside of the test cycle because git repos
  # last longer than the before/after :all test block in order to speed up specs.
  config.before(:suite) { clean_tmpdir }
  config.after(:suite) { clean_tmpdir }

  config.before(:all) do
    clean_eyrc
    FakeWeb.allow_net_connect = false
    ENV["CLOUD_URL"] = nil
    ENV["NO_SSH"] = "true"
  end

  config.after(:all) do
    clean_eyrc
  end

end

shared_examples_for "integration" do
  use_git_repo('default')

  before(:all) do
    FakeWeb.allow_net_connect = true
    ENV['CLOUD_URL'] = EY::CloudClient::Test::FakeAwsm.uri
  end

  after(:all) do
    ENV.delete('CLOUD_URL')
    FakeWeb.allow_net_connect = false
  end
end

Version data entries

17 entries across 17 versions & 2 rubygems

Version Path
crazy-yard-3.2.2 spec/spec_helper.rb
engineyard-3.2.3 spec/spec_helper.rb
engineyard-4.0.0.pre3 spec/spec_helper.rb
engineyard-4.0.0.pre2 spec/spec_helper.rb
engineyard-4.0.0.pre1 spec/spec_helper.rb
engineyard-3.2.1 spec/spec_helper.rb
engineyard-3.2.0 spec/spec_helper.rb
engineyard-3.1.3 spec/spec_helper.rb
engineyard-3.1.2 spec/spec_helper.rb
engineyard-3.1.1 spec/spec_helper.rb
engineyard-3.1.0 spec/spec_helper.rb
engineyard-3.0.1 spec/spec_helper.rb
engineyard-3.0.0 spec/spec_helper.rb
engineyard-2.3.3 spec/spec_helper.rb
engineyard-2.3.2 spec/spec_helper.rb
engineyard-2.3.1 spec/spec_helper.rb
engineyard-2.3.0 spec/spec_helper.rb