Sha256: f212c5812a7b4d10c0cfb9fe208b62f92e483f6f321a1e028eadede1086dd05d

Contents?: true

Size: 1.22 KB

Versions: 11

Compression:

Stored size: 1.22 KB

Contents

$:.push File.expand_path("../../lib", __FILE__)

require 'rubygems'
require 'bundler'
require 'rspec'
require 'spork'
require 'rack/test'

Spork.prefork do
  Dir[File.join(File.expand_path("../../spec/support/**/*.rb", __FILE__))].each { |f| require f }

  RSpec.configure do |config|
    config.include Berkshelf::RSpec::ChefServer

    config.expect_with :rspec do |c|
      c.syntax = :expect
    end

    config.mock_with :rspec
    config.treat_symbols_as_metadata_keys_with_true_values = true
    config.filter_run focus: true
    config.run_all_when_everything_filtered = true

    config.before(:suite) { Berkshelf::RSpec::ChefServer.start }
    config.before(:all) { Berkshelf::API::Logging.init(location: '/dev/null') }

    config.before do
      Celluloid.shutdown
      Celluloid.boot
      ENV['BERKSHELF_API_PATH'] = tmp_path.join('api-server').to_s
      clean_tmp_path
    end
  end

  def app_root_path
    Pathname.new(File.expand_path('../../', __FILE__))
  end

  def tmp_path
    app_root_path.join('spec/tmp')
  end

  def fixtures_path
    app_root_path.join('spec/fixtures')
  end

  def clean_tmp_path
    FileUtils.rm_rf(tmp_path)
    FileUtils.mkdir_p(tmp_path)
  end
end

Spork.each_run do
  require 'berkshelf/api'
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
berkshelf-api-2.1.3 spec/spec_helper.rb
berkshelf-api-2.1.2 spec/spec_helper.rb
berkshelf-api-2.1.1 spec/spec_helper.rb
berkshelf-api-2.1.0 spec/spec_helper.rb
berkshelf-api-2.0.0 spec/spec_helper.rb
berkshelf-api-1.4.0 spec/spec_helper.rb
berkshelf-api-1.3.1 spec/spec_helper.rb
berkshelf-api-1.3.0 spec/spec_helper.rb
berkshelf-api-1.2.2 spec/spec_helper.rb
berkshelf-api-1.2.1 spec/spec_helper.rb
berkshelf-api-1.2.0 spec/spec_helper.rb