spec/spec_helper.rb in rest-ftp-daemon-0.222.0 vs spec/spec_helper.rb in rest-ftp-daemon-0.230.0

- old
+ new

@@ -1,7 +1,9 @@ require "pathname" require "http" +require_relative "support/request_helpers" +require "pry" RSpec.configure do |config| # rspec-expectations config goes here. You can use an alternate # assertion/expectation library such as wrong or the stdlib/minitest # assertions if you prefer. @@ -45,11 +47,13 @@ config.profile_examples = 10 config.order = :random Kernel.srand config.seed - def call_server(command, config = Pathname(__dir__).join("support/config.yml")) - system(Pathname(__dir__).join("../bin/rest-ftp-daemon -e test -c #{config} #{command}").to_s, chdir: __dir__) or fail "Could not #{command} server" + include RequestHelpers + + def call_server(command, config = Pathname(__dir__).join("support/config.yml"), port = RequestHelpers::PORT) + system(Pathname(__dir__).join("../bin/rest-ftp-daemon -e test -c #{config} #{command} -p #{port}").to_s, chdir: __dir__) or fail "Could not #{command} server" end config.before :suite do call_server(:start) sleep 2