minor: test updates for JRuby in 1.9 mode

This commit is contained in:
Kyle Banker 2010-10-14 16:11:30 -04:00
parent e868f090a3
commit dd02b12282
3 changed files with 8 additions and 7 deletions

View File

@ -16,10 +16,6 @@ class TestConnection < Test::Unit::TestCase
@mongo[MONGO_TEST_DB].get_last_error
end
def test_slave_ok_with_multiple_nodes
end
def test_server_info
server_info = @mongo.server_info
assert server_info.keys.include?("version")

View File

@ -739,7 +739,12 @@ class DBAPITest < Test::Unit::TestCase
utf8 = "hello world".encode("UTF-8")
iso8859 = "hello world".encode("ISO-8859-1")
assert_equal "US-ASCII", ascii.encoding.name
if RUBY_PLATFORM =~ /jruby/
assert_equal "ASCII-8BIT", ascii.encoding.name
else
assert_equal "US-ASCII", ascii.encoding.name
end
assert_equal "UTF-8", utf8.encoding.name
assert_equal "ISO-8859-1", iso8859.encoding.name

View File

@ -19,7 +19,7 @@ MSG
exit
end
require 'bson_ext/cbson' if ENV['C_EXT']
require 'bson_ext/cbson' if !(RUBY_PLATFORM =~ /java/) && ENV['C_EXT']
unless defined? MONGO_TEST_DB
MONGO_TEST_DB = 'mongo-ruby-test'
@ -47,7 +47,7 @@ class Test::Unit::TestCase
end
def self.mongo_port
ENV['MONGO_RUBY_DRIVER_PORT'].to_i || 27017
ENV['MONGO_RUBY_DRIVER_PORT'] ? ENV['MONGO_RUBY_DRIVER_PORT'].to_i : 27017
end
def host_port