Skip to content

Commit c802c7e

Browse files
committed
minor: fixes for tests in Ruby 1.8.7
1 parent 4db1961 commit c802c7e

File tree

3 files changed

+14
-5
lines changed

3 files changed

+14
-5
lines changed

test/bson/test_helper.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
require File.join(File.dirname(__FILE__), '..', '..', 'lib', 'bson')
2-
require 'rubygems' if RUBY_VERSION < '1.9.0' && ENV['C_EXT']
3-
gem 'test-unit' if RUBY_VERSION > '1.9.0'
2+
require 'rubygems' if RUBY_VERSION < '1.9.0'
3+
gem 'test-unit'
44
require 'test/unit'
55

66
def silently

test/replica_sets/basic_test.rb

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,16 @@ def test_accessors
8989
rescue SystemStackError
9090
end
9191
end
92-
92+
end
93+
94+
context "checking out readers" do
95+
setup do
96+
seeds = build_seeds(3)
97+
args = {:name => @rs.name}
98+
@con = ReplSetConnection.new(seeds, args)
99+
@coll = @con[MONGO_TEST_DB]['test-connection-exceptions']
100+
end
101+
93102
should "close the connection on receive_message for major exceptions" do
94103
@con.expects(:checkout_reader).raises(SystemStackError)
95104
@con.expects(:close)

test/test_helper.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
$:.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
2-
require 'rubygems' if RUBY_VERSION < '1.9.0' && ENV['C_EXT']
2+
require 'rubygems' if RUBY_VERSION
33
require 'mongo'
4-
gem 'test-unit' if RUBY_VERSION > '1.9.0'
4+
gem 'test-unit'
55
require 'test/unit'
66

77
def silently

0 commit comments

Comments
 (0)