PageRenderTime 66ms CodeModel.GetById 17ms RepoModel.GetById 0ms app.codeStats 0ms

/dev-ruby/oauth/files/oauth-0.4.3-optional-tests.patch

https://github.com/1000timesdead/portage
Patch | 123 lines | 105 code | 18 blank | 0 comment | 0 complexity | 191513447e5131cc5f3c1fb24cd0e71f MD5 | raw file
  1. commit d71057125981d613aa77100cbd1edd278257aa40
  2. Author: Hans de Graaff <hans@degraaff.org>
  3. Date: Fri Jun 25 22:53:36 2010 +0200
  4. Fix LoadError rescue: return can't be used in this context.
  5. Using return leads to this error:
  6. ./test/test_curb_request_proxy.rb:8: unexpected return (LocalJumpError)
  7. Without using return the rescue needs to be placed at the end.
  8. diff --git a/test/test_curb_request_proxy.rb b/test/test_curb_request_proxy.rb
  9. index 582b18f..8abf245 100644
  10. --- a/test/test_curb_request_proxy.rb
  11. +++ b/test/test_curb_request_proxy.rb
  12. @@ -1,12 +1,9 @@
  13. require File.expand_path('../test_helper', __FILE__)
  14. begin
  15. - require 'oauth/request_proxy/curb_request'
  16. - require 'curb'
  17. -rescue LoadError => e
  18. - warn "! problems loading curb, skipping these tests: #{e}"
  19. - return
  20. -end
  21. +
  22. +require 'oauth/request_proxy/curb_request'
  23. +require 'curb'
  24. class CurbRequestProxyTest < Test::Unit::TestCase
  25. @@ -74,3 +71,7 @@ class CurbRequestProxyTest < Test::Unit::TestCase
  26. assert_equal 'http://example.com/test', request_proxy.normalized_uri
  27. end
  28. end
  29. +
  30. +rescue LoadError => e
  31. + warn "! problems loading curb, skipping these tests: #{e}"
  32. +end
  33. diff --git a/test/test_em_http_client.rb b/test/test_em_http_client.rb
  34. index 9d0994f..603fd8b 100644
  35. --- a/test/test_em_http_client.rb
  36. +++ b/test/test_em_http_client.rb
  37. @@ -1,10 +1,7 @@
  38. require File.expand_path('../test_helper', __FILE__)
  39. begin
  40. - require 'oauth/client/em_http'
  41. -rescue LoadError => e
  42. - warn "! problem loading em-http, skipping these tests: #{e}"
  43. - return
  44. -end
  45. +
  46. +require 'oauth/client/em_http'
  47. class EmHttpClientTest < Test::Unit::TestCase
  48. @@ -77,3 +74,7 @@ class EmHttpClientTest < Test::Unit::TestCase
  49. end
  50. end
  51. +
  52. +rescue LoadError => e
  53. + warn "! problem loading em-http, skipping these tests: #{e}"
  54. +end
  55. diff --git a/test/test_em_http_request_proxy.rb b/test/test_em_http_request_proxy.rb
  56. index 7b9b12b..ab0b5a5 100644
  57. --- a/test/test_em_http_request_proxy.rb
  58. +++ b/test/test_em_http_request_proxy.rb
  59. @@ -1,12 +1,9 @@
  60. require File.expand_path('../test_helper', __FILE__)
  61. begin
  62. - require 'em-http'
  63. - require 'oauth/request_proxy/em_http_request'
  64. -rescue LoadError => e
  65. - warn "! problem loading em-http, skipping these tests: #{e}"
  66. - return
  67. -end
  68. +
  69. +require 'em-http'
  70. +require 'oauth/request_proxy/em_http_request'
  71. class EmHttpRequestProxyTest < Test::Unit::TestCase
  72. @@ -110,5 +107,9 @@ class EmHttpRequestProxyTest < Test::Unit::TestCase
  73. arguments = opts.delete(:proxy_options) || {}
  74. OAuth::RequestProxy.proxy(create_client(opts), arguments)
  75. end
  76. +
  77. +end
  78. +rescue LoadError => e
  79. + warn "! problem loading em-http, skipping these tests: #{e}"
  80. end
  81. diff --git a/test/test_typhoeus_request_proxy.rb b/test/test_typhoeus_request_proxy.rb
  82. index ce69fb2..c809a6f 100644
  83. --- a/test/test_typhoeus_request_proxy.rb
  84. +++ b/test/test_typhoeus_request_proxy.rb
  85. @@ -1,13 +1,9 @@
  86. require File.expand_path('../test_helper', __FILE__)
  87. begin
  88. - require 'oauth/request_proxy/typhoeus_request'
  89. - require 'typhoeus'
  90. -rescue LoadError => e
  91. - warn "! problem loading typhoeus, skipping these tests: #{e}"
  92. - return
  93. -end
  94. +require 'oauth/request_proxy/typhoeus_request'
  95. +require 'typhoeus'
  96. class TyphoeusRequestProxyTest < Test::Unit::TestCase
  97. @@ -78,3 +74,8 @@ class TyphoeusRequestProxyTest < Test::Unit::TestCase
  98. assert_equal 'POST', request_proxy.method
  99. end
  100. end
  101. +
  102. +rescue LoadError => e
  103. + warn "! problem loading typhoeus, skipping these tests: #{e}"
  104. +end
  105. +