features/support/env.rb in berkshelf-1.4.5 vs features/support/env.rb in berkshelf-1.4.6

- old
+ new

@@ -9,12 +9,12 @@ require 'aruba/cucumber' APP_ROOT = File.expand_path('../../../', __FILE__) ENV['RUBY_ENV'] = 'test' - ENV["BERKSHELF_PATH"] = File.join(APP_ROOT, "tmp", "berkshelf") - ENV["BERKSHELF_CHEF_CONFIG"] = File.join(APP_ROOT, "spec", "knife.rb") + ENV['BERKSHELF_PATH'] = File.join(APP_ROOT, 'tmp', 'berkshelf') + ENV['BERKSHELF_CHEF_CONFIG'] = File.join(APP_ROOT, 'spec', 'config', 'knife.rb') # Workaround for RSA Fingerprint prompt in Travis CI git_ssh_path = '/tmp/git_ssh.sh' unless File.exist? git_ssh_path git_ssh = File.new(git_ssh_path, 'w+') @@ -33,18 +33,27 @@ Before do set_env 'RUBY_ENV', 'test' clean_cookbook_store generate_berks_config(File.join(ENV["BERKSHELF_PATH"], 'config.json')) @aruba_io_wait_seconds = 5 - @aruba_timeout_seconds = 16 + @aruba_timeout_seconds = 30 end Before('@slow_process') do @aruba_timeout_seconds = 60 @aruba_io_wait_seconds = 10 end + # Chef Zero + require 'chef_zero/server' + @server = ChefZero::Server.new(port: 4000, generate_real_keys: false) + @server.start_background + + at_exit do + @server.stop if @server && @server.running? + end + def cookbook_store Pathname.new(File.join(ENV["BERKSHELF_PATH"], "cookbooks")) end def clean_cookbook_store @@ -69,9 +78,7 @@ all_output end end Spork.each_run do - Berkshelf::RSpec::Knife.load_knife_config(File.join(APP_ROOT, 'spec/knife.rb')) - require 'berkshelf' end