spec/spec_helper.rb in berkshelf-1.4.5 vs spec/spec_helper.rb in berkshelf-1.4.6
- old
+ new
@@ -13,11 +13,11 @@
require 'webmock/rspec'
require 'vcr'
APP_ROOT = File.expand_path('../../', __FILE__)
ENV["BERKSHELF_PATH"] = File.join(APP_ROOT, "spec", "tmp", "berkshelf")
- ENV["BERKSHELF_CHEF_CONFIG"] = File.join(APP_ROOT, "spec", "knife.rb")
+ ENV["BERKSHELF_CHEF_CONFIG"] = File.join(APP_ROOT, "spec", "config", "knife.rb")
Dir[File.join(APP_ROOT, "spec/support/**/*.rb")].each {|f| require f}
VCR.configure do |config|
config.configure_rspec_metadata!
@@ -34,10 +34,19 @@
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) do
+ Berkshelf::RSpec::ChefServer.start
+ WebMock.disable_net_connect!(allow_localhost: true, net_http_connect_on_start: true)
+ end
+
+ config.after(:suite) do
+ Berkshelf::RSpec::ChefServer.stop
+ end
+
config.before(:each) do
clean_tmp_path
Berkshelf.cookbook_store = Berkshelf::CookbookStore.new(tmp_path.join("downloader_tmp"))
Berkshelf.ui.mute!
end
@@ -153,11 +162,9 @@
end
def run(cmd)
`#{cmd}`
end
-
- Berkshelf::RSpec::Knife.load_knife_config(File.join(APP_ROOT, 'spec/knife.rb'))
end
Spork.each_run do
require 'berkshelf'