minor: fixes for tests in Ruby 1.8.7

This commit is contained in:
Tyler Brock 2012-02-18 19:24:27 -05:00
parent 4db19610d6
commit c802c7eba3
3 changed files with 14 additions and 5 deletions

View File

@ -1,6 +1,6 @@
require File.join(File.dirname(__FILE__), '..', '..', 'lib', 'bson')
require 'rubygems' if RUBY_VERSION < '1.9.0' && ENV['C_EXT']
gem 'test-unit' if RUBY_VERSION > '1.9.0'
require 'rubygems' if RUBY_VERSION < '1.9.0'
gem 'test-unit'
require 'test/unit'
def silently

View File

@ -89,7 +89,16 @@ class BasicTest < Test::Unit::TestCase
rescue SystemStackError
end
end
end
context "checking out readers" do
setup do
seeds = build_seeds(3)
args = {:name => @rs.name}
@con = ReplSetConnection.new(seeds, args)
@coll = @con[MONGO_TEST_DB]['test-connection-exceptions']
end
should "close the connection on receive_message for major exceptions" do
@con.expects(:checkout_reader).raises(SystemStackError)
@con.expects(:close)

View File

@ -1,7 +1,7 @@
$:.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
require 'rubygems' if RUBY_VERSION < '1.9.0' && ENV['C_EXT']
require 'rubygems' if RUBY_VERSION
require 'mongo'
gem 'test-unit' if RUBY_VERSION > '1.9.0'
gem 'test-unit'
require 'test/unit'
def silently