faraday/test/helper.rb
rick 2d8c3619d8 faraday requires itself in tests, rather than the latest gems
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.
2011-12-28 10:58:28 -07:00

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)