Permalink
Browse files

Test for ruby version in one place

This adds a RUBY_1 constant that the entire test suite can use.
  • Loading branch information...
1 parent 5ea61ae commit c0812e21230221157d7e25a1d3b8f2a675c947e9 @drbrain committed Feb 9, 2013
Showing with 6 additions and 4 deletions.
  1. +6 −4 test/test_net_http_persistent.rb
@@ -56,11 +56,13 @@ class Net::HTTP::Persistent::SSLReuse
class TestNetHttpPersistent < MiniTest::Unit::TestCase
+ RUBY_1 = RUBY_VERSION < '2'
+
def setup
- @http_class = if RUBY_VERSION > '2.0' then
- Net::HTTP
- else
+ @http_class = if RUBY_1 then
Net::HTTP::Persistent::SSLReuse
+ else
+ Net::HTTP
end
@http = Net::HTTP::Persistent.new
@@ -1470,7 +1472,7 @@ def test_ssl_version_equals
assert_equal :ssl_version, @http.ssl_version
assert_equal 1, @http.ssl_generation
- end if RUBY_VERSION > '1.9'
+ end unless RUBY_1
def test_start
c = basic_connection

0 comments on commit c0812e2

Please sign in to comment.