spec/spec_helper.rb in berkshelf-3.0.0.beta3 vs spec/spec_helper.rb in berkshelf-3.0.0.beta4

- old
+ new

@@ -1,21 +1,25 @@ require 'spork' +def windows? + !!(RUBY_PLATFORM =~ /mswin|mingw|windows/) +end + Spork.prefork do require 'rspec' require 'webmock/rspec' - require 'berkshelf/api/rspec' + require 'berkshelf/api/rspec' unless windows? Dir['spec/support/**/*.rb'].each { |f| require File.expand_path(f) } RSpec.configure do |config| config.include Berkshelf::RSpec::FileSystemMatchers config.include Berkshelf::RSpec::ChefAPI config.include Berkshelf::RSpec::ChefServer config.include Berkshelf::RSpec::Git config.include Berkshelf::RSpec::PathHelpers - config.include Berkshelf::API::RSpec + config.include Berkshelf::API::RSpec unless windows? config.expect_with :rspec do |c| c.syntax = :expect end @@ -25,11 +29,11 @@ config.run_all_when_everything_filtered = true config.before(:suite) do WebMock.disable_net_connect!(allow_localhost: true, net_http_connect_on_start: true) Berkshelf::RSpec::ChefServer.start - Berkshelf::API::RSpec::Server.start + Berkshelf::API::RSpec::Server.start unless windows? Berkshelf.set_format(:null) Berkshelf.ui.mute! end config.after(:suite) do @@ -39,10 +43,10 @@ config.before(:all) do ENV['BERKSHELF_PATH'] = berkshelf_path.to_s end config.before(:each) do - Berkshelf::API::RSpec::Server.clear_cache + Berkshelf::API::RSpec::Server.clear_cache unless windows? clean_tmp_path Berkshelf.initialize_filesystem Berkshelf::CookbookStore.instance.initialize_filesystem reload_configs end