Skip to content

Commit

Permalink
Wrapping the tests in LoadError rescues to still run the tests when c…
Browse files Browse the repository at this point in the history
…ertain gems arent available
  • Loading branch information
quirkey committed May 19, 2010
1 parent d6f1a95 commit 4fd8964
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 11 deletions.
13 changes: 10 additions & 3 deletions test/test_curb_request_proxy.rb
@@ -1,6 +1,13 @@
require File.dirname(__FILE__) + '/test_helper.rb'
require 'oauth/request_proxy/curb_request'
require 'curb'
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


class CurbRequestProxyTest < Test::Unit::TestCase

Expand Down
9 changes: 7 additions & 2 deletions test/test_em_http_client.rb
@@ -1,5 +1,10 @@
require File.dirname(__FILE__) + '/test_helper.rb'
require 'oauth/client/em_http'
require 'test_helper'
begin
require 'oauth/client/em_http'
rescue LoadError => e
warn "! problem loading em-http, skipping these tests: #{e}"
return
end

class EmHttpClientTest < Test::Unit::TestCase

Expand Down
13 changes: 10 additions & 3 deletions test/test_em_http_request_proxy.rb
@@ -1,6 +1,13 @@
require File.dirname(__FILE__) + '/test_helper.rb'
require 'em-http'
require 'oauth/request_proxy/em_http_request'
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


class EmHttpRequestProxyTest < Test::Unit::TestCase

Expand Down
13 changes: 10 additions & 3 deletions test/test_typhoeus_request_proxy.rb
@@ -1,6 +1,13 @@
require File.dirname(__FILE__) + '/test_helper.rb'
require 'oauth/request_proxy/typhoeus_request'
require 'typhoeus'
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


class TyphoeusRequestProxyTest < Test::Unit::TestCase

Expand Down

0 comments on commit 4fd8964

Please sign in to comment.