Skip to content

Commit

Permalink
Bump mongo driver version and fix failing test due to that.
Browse files Browse the repository at this point in the history
  • Loading branch information
jnunemaker committed Apr 5, 2010
1 parent 31fd5fa commit 8b20b99
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 31 deletions.
18 changes: 1 addition & 17 deletions Rakefile
Expand Up @@ -13,7 +13,7 @@ Jeweler::Tasks.new do |gem|
gem.version = MongoMapper::Version

gem.add_dependency('activesupport', '>= 2.3.4')
gem.add_dependency('mongo', '0.19.1')
gem.add_dependency('mongo', '0.19.3')
gem.add_dependency('jnunemaker-validatable', '1.8.3')

gem.add_development_dependency('jnunemaker-matchy', '0.4.0')
Expand All @@ -32,21 +32,5 @@ Rake::TestTask.new(:test) do |test|
test.verbose = true
end

namespace :test do
Rake::TestTask.new(:units) do |test|
test.libs << 'test'
test.ruby_opts << '-rubygems'
test.pattern = 'test/unit/**/test_*.rb'
test.verbose = true
end

Rake::TestTask.new(:functionals) do |test|
test.libs << 'test'
test.ruby_opts << '-rubygems'
test.pattern = 'test/functional/**/test_*.rb'
test.verbose = true
end
end

task :default => :test
task :test => :check_dependencies
18 changes: 6 additions & 12 deletions lib/mongo_mapper.rb
@@ -1,19 +1,13 @@
# Make sure you have the following libs in your load path or you could have issues:
# gem 'activesupport', '>= 2.3.4'
# gem 'mongo', '0.19.3'
# gem 'jnunemaker-validatable', '1.8.3'
# gem 'activesupport', '= 2.3.4'
require 'set'
require 'uri'

# if Gem is defined i'll assume you are using rubygems and lock specific versions
# call me crazy but a plain old require will just get the latest version you have installed
# so i want to make sure that if you are using gems you do in fact have the correct versions
# if there is a better way to do this, please enlighten me!
if self.class.const_defined?(:Gem)
gem 'activesupport', '>= 2.3.4'
gem 'mongo', '0.19.1'
gem 'jnunemaker-validatable', '1.8.3'
end

require 'active_support/all'
require 'mongo'
require 'validatable'
require 'active_support/all'

module MongoMapper
# generic MM error
Expand Down
4 changes: 2 additions & 2 deletions test/functional/test_indexing.rb
Expand Up @@ -31,8 +31,8 @@ class IndexingTest < Test::Unit::TestCase
# just checking have_index('first_name_1_last_name_-1') I'm checking
# the values of the indexes to make sure the index creation was successful
@document.collection.index_information.detect do |index|
keys = index[1]
keys.include?(['first_name', 1]) && keys.include?(['last_name', -1])
keys = index[0]
keys.include?('first_name_1') && keys.include?('last_name_-1')
end.should_not be_nil
end

Expand Down

0 comments on commit 8b20b99

Please sign in to comment.