spec/spec_helper.rb in httplog-1.0.2 vs spec/spec_helper.rb in httplog-1.0.3

- old
+ new

@@ -1,7 +1,9 @@ -$:.unshift(File.join(File.dirname(__FILE__), '..', 'lib')) -$:.unshift(File.dirname(__FILE__)) +# frozen_string_literal: true + +$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib')) +$LOAD_PATH.unshift(File.dirname(__FILE__)) require 'rspec' require 'httpclient' require 'excon' # require 'typhoeus' require 'ethon' @@ -13,32 +15,30 @@ require 'httplog' require 'adapters/http_base_adapter' Dir[File.dirname(__FILE__) + '/adapters/*.rb'].each { |f| require f } -Dir["./spec/support/**/*.rb"].each {|f| require f} +Dir['./spec/support/**/*.rb'].each { |f| require f } # Start a local rack server to serve up test pages. @server_thread = Thread.new do - Rack::Handler::Thin.run Httplog::Test::Server.new, :Port => 9292 + Rack::Handler::Thin.run Httplog::Test::Server.new, Port: 9292 end sleep(3) # wait a moment for the server to be booted RSpec.configure do |config| - config.before(:each) do require 'stringio' @log = StringIO.new @logger = Logger.new @log - HttpLog.configure{ |c| c.logger = @logger } + HttpLog.configure { |c| c.logger = @logger } end config.after(:each) do HttpLog.reset! end - def log @log.string end end