igrigorik/em-synchrony — Issue #97: Running specs
Author: sujal
Created: 2011-12-23 00:24:53+00:00
State: open

I'm getting an require error trying to run the specs. I've tried a bunch of things, but I'm clearly missing something. I have a feeling this will end up being very obvious in hindsight once someone can take a look. Short version, it looks like em-synchrony/mongo requires 'mongo/connection' which uses Mongo::Logging. Since nothing requires the root include of the Mongo gem (require 'mongo'), nothing has loaded Logging, so it errors out with a NameError. It seems like it's doing the "right" thing, so I'm not sure how the tests could work for anyone else. Here's the relevant output:

```bash
sujal@codebliss:~/temp/em-synchrony (master)$ rake spec
/Users/sujal/.rvm/rubies/ruby-1.9.3-p0/bin/ruby -S rspec ./spec/activerecord_spec.rb ./spec/amqp_spec.rb ./spec/beanstalk_spec.rb ./spec/connection_pool_spec.rb ./spec/em-mongo_spec.rb ./spec/fiber_iterator_spec.rb ./spec/hiredis_spec.rb ./spec/http_spec.rb ./spec/inlinesync_spec.rb ./spec/iterator_spec.rb ./spec/keyboard_spec.rb ./spec/memcache_spec.rb ./spec/mongo_spec.rb ./spec/multi_spec.rb ./spec/mysql2_spec.rb ./spec/redis_spec.rb ./spec/remcached_spec.rb ./spec/synchrony_spec.rb ./spec/tcpsocket_spec.rb ./spec/thread_spec.rb ./spec/timer_spec.rb
/Users/sujal/temp/em-synchrony/spec/beanstalk_spec.rb:3: warning: already initialized constant DELAY
/Users/sujal/temp/em-synchrony/spec/connection_pool_spec.rb:3: warning: already initialized constant DELAY
/Users/sujal/temp/em-synchrony/spec/connection_pool_spec.rb:4: warning: already initialized constant QUERY
/Users/sujal/temp/em-synchrony/spec/http_spec.rb:5: warning: already initialized constant DELAY
/Users/sujal/temp/em-synchrony/spec/inlinesync_spec.rb:6: warning: already initialized constant URL
/Users/sujal/temp/em-synchrony/spec/inlinesync_spec.rb:7: warning: already initialized constant DELAY
/Users/sujal/temp/em-synchrony/spec/keyboard_spec.rb:4: warning: already initialized constant DELAY
/Users/sujal/.rvm/gems/ruby-1.9.3-p0/gems/mongo-1.5.2/lib/mongo/connection.rb:26:in `': uninitialized constant Mongo::Logging (NameError)
from /Users/sujal/.rvm/gems/ruby-1.9.3-p0/gems/mongo-1.5.2/lib/mongo/connection.rb:25:in `'
from /Users/sujal/.rvm/gems/ruby-1.9.3-p0/gems/mongo-1.5.2/lib/mongo/connection.rb:22:in `'
from /Users/sujal/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:59:in `require'
from /Users/sujal/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:59:in `rescue in require'
from /Users/sujal/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:35:in `require'
from /Users/sujal/temp/em-synchrony/lib/em-synchrony/mongo.rb:2:in `'
from /Users/sujal/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /Users/sujal/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /Users/sujal/temp/em-synchrony/spec/mongo_spec.rb:2:in `'
from /Users/sujal/.rvm/gems/ruby-1.9.3-p0/gems/rspec-core-2.7.1/lib/rspec/core/configuration.rb:459:in `block in load_spec_files'
from /Users/sujal/.rvm/gems/ruby-1.9.3-p0/gems/rspec-core-2.7.1/lib/rspec/core/configuration.rb:459:in `map'
from /Users/sujal/.rvm/gems/ruby-1.9.3-p0/gems/rspec-core-2.7.1/lib/rspec/core/configuration.rb:459:in `load_spec_files'
from /Users/sujal/.rvm/gems/ruby-1.9.3-p0/gems/rspec-core-2.7.1/lib/rspec/core/command_line.rb:18:in `run'
from /Users/sujal/.rvm/gems/ruby-1.9.3-p0/gems/rspec-core-2.7.1/lib/rspec/core/runner.rb:80:in `run_in_process'
from /Users/sujal/.rvm/gems/ruby-1.9.3-p0/gems/rspec-core-2.7.1/lib/rspec/core/runner.rb:69:in `run'
from /Users/sujal/.rvm/gems/ruby-1.9.3-p0/gems/rspec-core-2.7.1/lib/rspec/core/runner.rb:10:in `block in autorun'
rake aborted!
ruby /Users/sujal/.rvm/rubies/ruby-1.9.3-p0/bin/ruby -S rspec ./spec/activerecord_spec.rb ./spec/amqp_spec.rb ./spec/beanstalk_spec.rb ./spec/connection_pool_spec.rb ./spec/em-mongo_spec.rb ./spec/fiber_iterator_spec.rb ./spec/hiredis_spec.rb ./spec/http_spec.rb ./spec/inlinesync_spec.rb ./spec/iterator_spec.rb ./spec/keyboard_spec.rb ./spec/memcache_spec.rb ./spec/mongo_spec.rb ./spec/multi_spec.rb ./spec/mysql2_spec.rb ./spec/redis_spec.rb ./spec/remcached_spec.rb ./spec/synchrony_spec.rb ./spec/tcpsocket_spec.rb ./spec/thread_spec.rb ./spec/timer_spec.rb failed
```