From 57ae696b58bee6ee5701e24f31afc5ab25d6bb00 Mon Sep 17 00:00:00 2001 From: "Peter M. Goldstein" <peter.m.goldstein@gmail.com> Date: Tue, 31 Jul 2012 11:55:47 -0700 Subject: [PATCH] Travis config including 1.8.7, 1.9.2, 1.9.3, and JRuby. --- .travis.yml | 23 +++++++++++++++++++++++ gemfiles/Gemfile.mongoid-2.4.x | 15 +++++++++++++++ test/test_helper.rb | 9 +++------ 3 files changed, 41 insertions(+), 6 deletions(-) create mode 100644 .travis.yml create mode 100644 gemfiles/Gemfile.mongoid-2.4.x diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 00000000..460484cd --- /dev/null +++ b/.travis.yml @@ -0,0 +1,23 @@ +rvm: + - 1.8.7 + - 1.9.2 + - 1.9.3 + - jruby-19mode +gemfile: + - Gemfile + - gemfiles/Gemfile.mongoid-2.4.x +env: SSL_CERT_DIR=/etc/ssl/certs +matrix: + exclude: + - rvm: 1.8.7 + gemfile: Gemfile + env: SSL_CERT_DIR=/etc/ssl/certs + - rvm: 1.9.2 + gemfile: Gemfile + env: SSL_CERT_DIR=/etc/ssl/certs + - rvm: 1.9.3 + gemfile: gemfiles/Gemfile.mongoid-2.4.x + env: SSL_CERT_DIR=/etc/ssl/certs + - rvm: jruby-19mode + gemfile: gemfiles/Gemfile.mongoid-2.4.x + env: SSL_CERT_DIR=/etc/ssl/certs diff --git a/gemfiles/Gemfile.mongoid-2.4.x b/gemfiles/Gemfile.mongoid-2.4.x new file mode 100644 index 00000000..e3fe031d --- /dev/null +++ b/gemfiles/Gemfile.mongoid-2.4.x @@ -0,0 +1,15 @@ +source "http://rubygems.org" + +gemspec :path => '..' + +group :development, :test do + gem 'rake' + gem 'mongoid', '2.4.11' + gem 'bson_ext', :platforms => :ruby + + gem 'rails' + + platforms :jruby do + gem 'jruby-openssl' + end +end diff --git a/test/test_helper.rb b/test/test_helper.rb index ba48c172..61b1d058 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -273,12 +273,9 @@ class Test::Unit::TestCase end def is_nan_coordinates?(coordinates) - if defined?(::Float::NAN) - coordinates == ([ Geocoder::Calculations::NAN ] * 2 ) - else - return false unless coordinates.respond_to? :size - coordinates.size == 2 && coordinates[0].nan? && coordinates[1].nan? - end + return false unless coordinates.respond_to? :size # Should be an array + return false unless coordinates.size == 2 # Should have dimension 2 + coordinates[0].nan? && coordinates[1].nan? # Both coordinates should be NaN end end -- GitLab