Sha256: b2e655b23a9375ba63bd89132fd3c8f99dfd3318794e99a5c465fcada40a23bb

Contents?: true

Size: 1.42 KB

Versions: 18

Compression:

Stored size: 1.42 KB

Contents

require 'rubygems' unless defined?(Gem)
require 'bundler'
# begin
#   Bundler.setup(:default, :development)
# rescue Bundler::BundlerError => e
#   $stderr.puts e.message
#   $stderr.puts "Run `bundle install` to install missing gems"
#   exit e.status_code
# end
require 'spork'

unless defined?(CLUSTER_CHEF_DIR)
  CLUSTER_CHEF_DIR = File.expand_path(File.dirname(__FILE__)+'/..')
  def CLUSTER_CHEF_DIR(*paths) File.join(CLUSTER_CHEF_DIR, *paths); end
  # load from vendored libraries, if present
  Dir[CLUSTER_CHEF_DIR("vendor/*/lib")].each{|dir| p dir ;  $LOAD_PATH.unshift(File.expand_path(dir)) } ; $LOAD_PATH.uniq!
end

Spork.prefork do # This code is run only once when the spork server is started

  require 'rspec'
  require 'chef'
  require 'chef/knife'
  require 'fog'

  Fog.mock!
  Fog::Mock.delay = 0

  CHEF_CONFIG_FILE = File.expand_path(CLUSTER_CHEF_DIR('spec/test_config.rb')) unless defined?(CHEF_CONFIG_FILE)
  Chef::Config.from_file(CHEF_CONFIG_FILE)

  # Requires custom matchers & macros, etc from files in ./spec_helper/
  Dir[CLUSTER_CHEF_DIR("spec/spec_helper/*.rb")].each {|f| require f}

  def load_example_cluster(name)
    require(CLUSTER_CHEF_DIR('clusters', "#{name}.rb"))
  end
  def get_example_cluster name
    load_example_cluster(name)
    ClusterChef.cluster(name)
  end

  # Configure rspec
  RSpec.configure do |config|
  end
end

Spork.each_run do
  # This code will be run each time you run your specs.
end

Version data entries

18 entries across 18 versions & 2 rubygems

Version Path
cluster_chef-3.0.14 spec/spec_helper.rb
cluster_chef-knife-3.0.14 spec/spec_helper.rb
cluster_chef-3.0.12 spec/spec_helper.rb
cluster_chef-knife-3.0.12 spec/spec_helper.rb
cluster_chef-3.0.11 spec/spec_helper.rb
cluster_chef-knife-3.0.11 spec/spec_helper.rb
cluster_chef-3.0.10 spec/spec_helper.rb
cluster_chef-knife-3.0.10 spec/spec_helper.rb
cluster_chef-3.0.9 spec/spec_helper.rb
cluster_chef-knife-3.0.9 spec/spec_helper.rb
cluster_chef-3.0.8 spec/spec_helper.rb
cluster_chef-knife-3.0.8 spec/spec_helper.rb
cluster_chef-3.0.7 spec/spec_helper.rb
cluster_chef-3.0.6 spec/spec_helper.rb
cluster_chef-knife-3.0.7 spec/spec_helper.rb
cluster_chef-knife-3.0.6 spec/spec_helper.rb
cluster_chef-3.0.5 spec/spec_helper.rb
cluster_chef-knife-3.0.5 spec/spec_helper.rb