337 Commits

Author SHA1 Message Date
Rafael Mendonça França
0adc6c69b2 Get the default values for the instrumenter options 2013-08-05 16:28:21 -03:00
Mislav Marohnić
010f81976f skip SSL peer verification test for Patron 2013-07-27 14:38:20 +02:00
Mislav Marohnić
4ac193943b wrap OpenSSL exceptions in Faraday's own SSLError class 2013-07-27 14:38:20 +02:00
Mislav Marohnić
7380ffc137 bump multipart-post dependency for Ruby 2.0 compatibility 2013-07-27 00:29:46 +02:00
Mislav Marohnić
9427063d97 hack HTTPClient to enable proxy integration tests
HTTPClient considers "localhost" to always be on a no-proxy list, thus
disabling our attempts to have integration tests on localhost. We
override its NO_PROXY_HOSTS constant during tests.
2013-07-27 00:29:45 +02:00
Mislav Marohnić
0a1deaf173 add integration tests for HTTP proxy support
Spins up a proxy server in a separate process, runs a few requests
through it with each adapter to verify that both proxy support and basic
authentication take effect.
2013-07-27 00:29:44 +02:00
Mislav Marohnić
9c7eb9c643 enable hash-style access to special Options properties
Makes these equivalent:

  options[:request] == options.request
  proxy[:password] == proxy.password
2013-07-27 00:29:44 +02:00
Mislav Marohnić
f28bf056cf ensure consistent handling of connection failures
All adapters should now raise Faraday::Error::ConnectionFailed
2013-07-27 00:29:41 +02:00
Mislav Marohnić
cff8dded75 add "http://" scheme to ENV['http_proxy'] value if missing
This allows:

    http_proxy=localhost:8888 ruby myscript.rb

Omitting the scheme is already supported by curl, and this matches that
behavior.
2013-07-27 00:29:41 +02:00
Lloyd
4488ce523e fix multipart post for servers that choke on Content-Type
Some servers such as Exchange 2010 don't like that there isn't a space
after a semicolon separator in the Content-Type request header. Since
Net::HTTPHeader#set_content_type adds the space, as well as it appearing
in the examples of RFC 2616, this follows suit and adds a space which
should help bad-behaving servers and not harm others.
2013-07-12 13:01:03 +02:00
Steve Agalloco
853b874480 use an array instead of a hash for testing pretty_inspect of objects 2013-07-05 11:42:26 -04:00
Steve Agalloco
fb6ed87714 added options hash to Logger to support logging bodies 2013-07-05 11:42:26 -04:00
Steve Agalloco
0e5c87ee43 log request bodies in logger middleware 2013-07-05 11:42:26 -04:00
Mislav Marohnić
e837ffdc69 fix minitest require in Bundler standalone mode
https://travis-ci.org/lostisland/faraday/jobs/8411907

In Bundler standalone, the `gem` method is still available but the
minitest gem won't be found. Only use the `gem` method when we're
running in the context of Bundler normal mode.
2013-06-25 08:12:36 +02:00
Mislav Marohnić
bf973245b5 fix brittle URI parser tests failing on Rubinius
The tests relied on the output of Method#to_s, which seems unreliable on
non-MRI Rubies. Avoid that and ensure the default_uri_parser is restored.
2013-06-25 06:14:41 +02:00
Mislav Marohnić
8080e54f55 proper loading of minitest
blessed by @zenspider:
https://twitter.com/the_zenspider/status/348563962880733184
2013-06-25 05:56:32 +02:00
Mislav Marohnić
872b45a781 configure script/test to not tolerate Ruby warnings
This makes CI fail if code is added to the project that generates
warnings in Ruby's verbose mode.
2013-06-25 05:55:26 +02:00
Mislav Marohnić
26ab2a7f2c fix randomly failing tests due to improper teardown 2013-06-25 04:52:33 +02:00
Mislav Marohnić
4f826047a7 use Minitest 5.0 2013-06-25 04:12:01 +02:00
Mislav Marohnić
a23124ea7b avoid ruby syntax warnings 2013-06-25 04:11:31 +02:00
Mislav Marohnić
cad28c0ef3 simpler FakeSafeBuffer implementation for testing
references #93
2013-06-25 03:58:14 +02:00
Jason Garber
c328e5285a Fix #93 again: ActiveSupport::SafeBuffer#gsub bug 2013-06-24 11:03:39 -04:00
rick
2c5bf666b3 fix Faraday::Options#update 2013-06-22 17:24:52 -07:00
rick
615516bbb5 allow initializing of Faraday::Options with falsey values 2013-05-13 15:14:51 -06:00
rick
7cdff322cf respect Faraday::RequestOptions#params_encoder
Fixes #269
2013-05-13 14:38:14 -06:00
rick
7aeda79760 don't need to chomp that last / off
Fixes #212
2013-05-13 13:27:39 -06:00
rick
5af44c90e1 stop testing with Connection#build_url since nothing uses it 2013-05-13 13:26:28 -06:00
risk danger olson
f94f30f1bf allow Utils.default_uri_parser to take a URI object that responds to #parse 2013-05-08 09:01:07 -06:00
Mislav Marohnić
50f853048e skip Typhoeus file upload test
Avoids random failures that happen in combination with WEBrick
2013-04-04 03:34:19 +02:00
Mislav Marohnić
c2adfbf918 rewrite test script in bash
The HTTP server is now started in a subprocess, not a thread. Running it
in a Ruby thread had all sorts of problems on different Rubies, such as
random failures on Rubinius.

The new script also avoids starting the HTTP server if not needed, e.g.
if filtering arguments have been used to select only the non-adapter tests.

The script dumps the server log to stdout if any tests failed on Travis.

Avoids auto-starting the debugger because it blocks for input in Rubinius
https://travis-ci.org/lostisland/faraday/jobs/5956815
2013-04-04 01:33:36 +02:00
Mislav Marohnić
7a38f177dc fix net-http-persistent timeout detection on Ruby 2.0
Re-enable timeout test because drbrain/net-http-persistent#33 got fixed
in net-http-persistent 2.8
2013-04-02 21:41:58 +02:00
Joe Pym
ca8c169072 fix escaping Unicode characters in Ruby 1.8.7
In Ruby 1.8, when you are operating with unicode encoding, \w includes
UTF-8 characters such as ☃. Faraday therefore does not escape these
correctly.

Closes #245
2013-03-24 18:07:11 +01:00
Erik Michaels-Ober
36379e01af Add Coveralls for code coverage reporting 2013-02-25 11:30:46 -08:00
Mislav Marohnić
28653690c6 fix copy_stream test for Rubinius and JRuby 2013-02-25 03:02:46 +01:00
Mislav Marohnić
f619a5d334 fix file uploads with Ruby 2.0 net/http
Rewrite Faraday::CompositeReadIO because the one inherited from
multipart-post library doesn't behave well when used with
IO.copy_stream which net/http uses internally in Ruby 2.0.
2013-02-25 03:02:45 +01:00
Mislav Marohnić
ebbf413b36 skip Typhoeus cert test in non-SSL mode 2013-02-25 02:37:05 +01:00
Colin Jones
4f37e8c0ef Add test to prove rejection of invalid peer 2013-01-16 15:25:42 -06:00
Lucas Mazza
abccadd2be Convert Env keys to symbols 2013-01-07 22:57:40 -02:00
technoweenie
2793e2ae91 ok rbx handles NameError differently 2013-01-05 11:12:31 -07:00
technoweenie
df484dfd1a match against ActiveSupport anywhere in the error name 2013-01-05 11:06:20 -07:00
technoweenie
4b30bf8b5e add instrumentation middleware. original work by @mislav
https://github.com/pengwynn/faraday_middleware/commit/23d5e614eea4f48dd5
a0eee68eb8b3d5e65b5275
2013-01-05 10:41:02 -07:00
technoweenie
e63f490693 more ProxyOptions tests 2012-12-30 11:35:16 -07:00
technoweenie
03504db53b allow you to set RequestOptions#proxy 2012-12-30 11:26:35 -07:00
technoweenie
b035bcb990 make NestedParamsEncoder the default in 0.9 2012-12-28 09:24:42 -07:00
Mislav Marohnić
26e9869f0b fix test runner after move to minitest
`testrb` utility is gone from minitest. `autorun` is needed if you want
the test to actually run
2012-12-28 15:53:27 +01:00
technoweenie
55c03addc2 Merge commit 'f9b8fe8546c2546811d7b68e4020cd17f890d45e' into fix-ci 2012-12-28 01:42:28 -07:00
technoweenie
758ad95587 removed autoload, caused problems with the Test adapter tests SOMETIMES 2012-12-28 01:41:27 -07:00
Karl Eklund
f9b8fe8546 Add support for headers to the test adapter 2012-12-20 12:07:07 +01:00
Erik Michaels-Ober
faab1b08cd Replace test-unit with minitest 2012-12-16 20:22:03 -08:00
technoweenie
76b53a6c2c add Faraday::Options#delete 2012-10-28 23:45:47 -06:00