mirror of
https://github.com/lostisland/faraday.git
synced 2025-11-27 00:04:03 -05:00
It bugs me when libraries load themselves through ruby gems in tests. I have to go through the full rake repackage workflow to test my changes, rather than simply changing the files. This also prevents a Faraday lib that's been loaded outside of ruby gems from reloading the anincompatiblee Faraday from rubygems.
37 lines
687 B
Ruby
37 lines
687 B
Ruby
require 'test/unit'
|
|
|
|
if ENV['LEFTRIGHT']
|
|
begin
|
|
require 'leftright'
|
|
rescue LoadError
|
|
puts "Run `gem install leftright` to install leftright."
|
|
end
|
|
end
|
|
|
|
require File.expand_path('../../lib/faraday', __FILE__)
|
|
|
|
begin
|
|
require 'ruby-debug'
|
|
rescue LoadError
|
|
# ignore
|
|
else
|
|
Debugger.start
|
|
end
|
|
|
|
module Faraday
|
|
class TestCase < Test::Unit::TestCase
|
|
LIVE_SERVER = case ENV['LIVE']
|
|
when /^http/ then ENV['LIVE']
|
|
when nil then nil
|
|
else 'http://localhost:4567'
|
|
end
|
|
|
|
def test_default
|
|
assert true
|
|
end unless defined? ::MiniTest
|
|
end
|
|
end
|
|
|
|
require 'webmock/test_unit'
|
|
WebMock.disable_net_connect!(:allow => Faraday::TestCase::LIVE_SERVER)
|