Fix loading (or rather, not loading) of optional tests. Submitted upstream. http://github.com/graaff/oauth-ruby/commit/de7fd4a02edf236e74f4bb84eeafb02597500d79 diff --git a/test/test_curb_request_proxy.rb b/test/test_curb_request_proxy.rb index ae5cb50..af15435 100644 --- a/test/test_curb_request_proxy.rb +++ b/test/test_curb_request_proxy.rb @@ -1,12 +1,9 @@ require 'test_helper' begin - require 'oauth/request_proxy/curb_request' - require 'curb' -rescue LoadError => e - warn "! problems loading curb, skipping these tests: #{e}" - return -end + +require 'oauth/request_proxy/curb_request' +require 'curb' class CurbRequestProxyTest < Test::Unit::TestCase @@ -73,4 +70,8 @@ class CurbRequestProxyTest < Test::Unit::TestCase assert_equal expected_parameters, request_proxy.parameters_for_signature assert_equal 'http://example.com/test', request_proxy.normalized_uri end -end \ No newline at end of file +end + +rescue LoadError => e + warn "! problems loading curb, skipping these tests: #{e}" +end diff --git a/test/test_em_http_client.rb b/test/test_em_http_client.rb index 8b8642f..c3f97e5 100644 --- a/test/test_em_http_client.rb +++ b/test/test_em_http_client.rb @@ -1,10 +1,7 @@ require 'test_helper' begin - require 'oauth/client/em_http' -rescue LoadError => e - warn "! problem loading em-http, skipping these tests: #{e}" - return -end + +require 'oauth/client/em_http' class EmHttpClientTest < Test::Unit::TestCase @@ -77,3 +74,7 @@ class EmHttpClientTest < Test::Unit::TestCase end end + +rescue LoadError => e + warn "! problem loading em-http, skipping these tests: #{e}" +end diff --git a/test/test_em_http_request_proxy.rb b/test/test_em_http_request_proxy.rb index 055a95a..f0200a7 100644 --- a/test/test_em_http_request_proxy.rb +++ b/test/test_em_http_request_proxy.rb @@ -1,12 +1,9 @@ require 'test_helper' begin - require 'em-http' - require 'oauth/request_proxy/em_http_request' -rescue LoadError => e - warn "! problem loading em-http, skipping these tests: #{e}" - return -end + +require 'em-http' +require 'oauth/request_proxy/em_http_request' class EmHttpRequestProxyTest < Test::Unit::TestCase @@ -111,4 +108,8 @@ class EmHttpRequestProxyTest < Test::Unit::TestCase OAuth::RequestProxy.proxy(create_client(opts), arguments) end -end \ No newline at end of file +end + +rescue LoadError => e + warn "! problem loading em-http, skipping these tests: #{e}" +end diff --git a/test/test_typhoeus_request_proxy.rb b/test/test_typhoeus_request_proxy.rb index 4044604..c54ad8e 100644 --- a/test/test_typhoeus_request_proxy.rb +++ b/test/test_typhoeus_request_proxy.rb @@ -1,13 +1,9 @@ require 'test_helper' begin - require 'oauth/request_proxy/typhoeus_request' - require 'typhoeus' -rescue LoadError => e - warn "! problem loading typhoeus, skipping these tests: #{e}" - return -end +require 'oauth/request_proxy/typhoeus_request' +require 'typhoeus' class TyphoeusRequestProxyTest < Test::Unit::TestCase @@ -78,3 +74,8 @@ class TyphoeusRequestProxyTest < Test::Unit::TestCase assert_equal 'POST', request_proxy.method end end + +rescue LoadError => e + warn "! problem loading typhoeus, skipping these tests: #{e}" +end +