From dd02b12282d49cfcd0d193811e5daacf4711c6bb Mon Sep 17 00:00:00 2001 From: Kyle Banker Date: Thu, 14 Oct 2010 16:11:30 -0400 Subject: [PATCH] minor: test updates for JRuby in 1.9 mode --- test/connection_test.rb | 4 ---- test/db_api_test.rb | 7 ++++++- test/test_helper.rb | 4 ++-- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/test/connection_test.rb b/test/connection_test.rb index 9ce60e9..f942b8e 100644 --- a/test/connection_test.rb +++ b/test/connection_test.rb @@ -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") diff --git a/test/db_api_test.rb b/test/db_api_test.rb index 41584b5..c32ea19 100644 --- a/test/db_api_test.rb +++ b/test/db_api_test.rb @@ -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 diff --git a/test/test_helper.rb b/test/test_helper.rb index 348684e..4d9cb78 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -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