Skip to content
Browse files

Small hack to fix tests in 1.9.3 due to small change in Net:HTTP form…

… data encoding
  • Loading branch information...
1 parent e3527a2 commit 953b96da7fbd393e14ac702a260316bf0d7971b9 Hayes Davis committed Jun 10, 2012
Showing with 7 additions and 1 deletion.
  1. +7 −1 test/client_test.rb
View
8 test/client_test.rb
@@ -403,7 +403,13 @@ def test_simple_post(client)
assert_equal('http',client.transport.url.scheme,"Expected scheme to be http")
assert_equal('api.twitter.com',client.transport.url.host,"Expected request to be against twitter.com")
assert_equal('/1/statuses/update.json',client.transport.url.path)
- assert_match(/status=test%20status/,Net::HTTP.request.body,"Parameters should be form encoded")
+
+ if RUBY_VERSION >= "1.9.3"
+ # 1.9.3 encodes a space with a + instead of %20
+ assert_match(/status=test\+status/,Net::HTTP.request.body,"Parameters should be form encoded")
+ else
+ assert_match(/status=test%20status/,Net::HTTP.request.body,"Parameters should be form encoded")
+ end
assert_equal(12345,value.id)
yield(client) if block_given?
end

0 comments on commit 953b96d

Please sign in to comment.
Something went wrong with that request. Please try again.