features/support/env.rb in berkshelf-3.0.0.beta3 vs features/support/env.rb in berkshelf-3.0.0.beta4
- old
+ new
@@ -1,14 +1,18 @@
require 'spork'
+def windows?
+ !!(RUBY_PLATFORM =~ /mswin|mingw|windows/)
+end
+
Spork.prefork do
require 'aruba/cucumber'
require 'aruba/in_process'
require 'aruba/spawn_process'
require 'cucumber/rspec/doubles'
- require 'berkshelf/api/rspec'
- require 'berkshelf/api/cucumber'
+ require 'berkshelf/api/rspec' unless windows?
+ require 'berkshelf/api/cucumber' unless windows?
Dir['spec/support/**/*.rb'].each { |f| require File.expand_path(f) }
World(Berkshelf::RSpec::PathHelpers)
World(Berkshelf::RSpec::Kitchen)
@@ -16,11 +20,11 @@
CHEF_SERVER_PORT = 26310
BERKS_API_PORT = 26210
at_exit do
Berkshelf::RSpec::ChefServer.stop
- Berkshelf::API::RSpec::Server.stop
+ Berkshelf::API::RSpec::Server.stop unless windows?
end
Before do
# Legacy ENV variables until we can move over to all InProcess
ENV['BERKSHELF_PATH'] = berkshelf_path.to_s
@@ -48,10 +52,10 @@
}
}
]
Berkshelf::RSpec::ChefServer.start(port: CHEF_SERVER_PORT)
- Berkshelf::API::RSpec::Server.start(port: BERKS_API_PORT, endpoints: endpoints)
+ Berkshelf::API::RSpec::Server.start(port: BERKS_API_PORT, endpoints: endpoints) unless windows?
@aruba_io_wait_seconds = Cucumber::JRUBY ? 7 : 5
@aruba_timeout_seconds = Cucumber::JRUBY ? 35 : 15
end