fix specs on windows

This commit is contained in:
Eliott Appleford 2014-07-03 20:13:22 +01:00
parent ba38498909
commit e2e3c1e3fb
8 changed files with 24 additions and 23 deletions

View file

@ -1,13 +1,21 @@
MIDDLEMAN_ROOT_PATH = File.dirname(File.dirname(File.dirname(__FILE__)))
MIDDLEMAN_BIN_PATH = File.join(MIDDLEMAN_ROOT_PATH, 'bin')
ENV['PATH'] = "#{MIDDLEMAN_BIN_PATH}#{File::PATH_SEPARATOR}#{ENV['PATH']}"
require 'aruba/cucumber'
require 'aruba/jruby'
require 'middleman-core/step_definitions/middleman_steps'
require 'middleman-core/step_definitions/builder_steps'
require 'middleman-core/step_definitions/server_steps'
# Monkeypatch for windows support
module ArubaMonkeypatch
def detect_ruby(cmd)
if cmd.start_with?('middleman ') && Gem.win_platform?
"#{current_ruby} #{Dir.pwd}/bin/#{cmd}"
else
cmd.sub(/^ruby(?= )/, current_ruby)
end
end
end
World(ArubaMonkeypatch)
Before do
@aruba_timeout_seconds = RUBY_PLATFORM == 'java' ? 120 : 60
end