[Rspec-devel] Using rspec with rails plugins, engines, etc.

aslak hellesoy aslak.hellesoy at gmail.com
Mon Aug 28 20:56:28 EDT 2006

On 8/29/06, Jay Levitt <lists-rspec at shopwatch.org> wrote:
> I'm developing an engine that I'd like to design with rspec.  I
> generated rspec in the main (stub) application, and then moved the spec
> folder to the engine.  Some quick modifications to the environment and
> fixtures paths in spec_helper.rb got me running, but I'd like to be able
> to use rails_spec_runner now that it's working.
> I start rails_spec_runner in the main rails dir, and then in a separate
> shell I type "script/rails_spec vendor/plugins/myplugin/spec/*".  It
> mostly works, but the output is a bit noisy; I get some "already
> initialized constant" warnings, and the backtrace seems to include all
> of drb as well as rspec_on_rails.  Specifics below:
> --------
> $ script/rails_spec vendor/plugins/myplugin/spec/*
> /cygdrive/c/dev/src/eclipse/myplugin/config/environment.rb:8: warning:
> already initialized constant RAILS_GEM_VERSION
> script/../config/../vendor/plugins/myplugin/init_engine.rb:4: warning:
> already initialized constant Major
> script/../config/../vendor/plugins/myplugin/init_engine.rb:5: warning:
> already initialized constant Minor
> script/../config/../vendor/plugins/myplugin/init_engine.rb:6: warning:
> already initialized constant Release
> .F
> 1)
> Spec::Api::ExpectationNotMetError in 'myplugin class with fixtures
> loaded should have more specifications'
> not enough specs
> ./vendor/plugins/myplugin/spec/models/myplugin_spec.rb:11:in `should
> have more specifications'
> ./script/../config/../vendor/plugins/rspec/lib/rspec_on_rails.rb:103:in
> `run'
> script/rails_spec_runner:26:in `run'
> /usr/lib/ruby/1.8/drb/drb.rb:1552:in `perform_without_block'
> /usr/lib/ruby/1.8/drb/drb.rb:1512:in `perform'
> /usr/lib/ruby/1.8/drb/drb.rb:1586:in `main_loop'
> /usr/lib/ruby/1.8/drb/drb.rb:1582:in `main_loop'
> /usr/lib/ruby/1.8/drb/drb.rb:1578:in `main_loop'
> /usr/lib/ruby/1.8/drb/drb.rb:1427:in `run'
> /usr/lib/ruby/1.8/drb/drb.rb:1424:in `run'
> /usr/lib/ruby/1.8/drb/drb.rb:1344:in `initialize'
> /usr/lib/ruby/1.8/drb/drb.rb:1624:in `start_service'
> script/rails_spec_runner:47

I've seen those myself I think.
Could you please submit a bug report for each of these issues?

Apart from annoying warnings is it working okay with multiple runs?


> _______________________________________________
> Rspec-devel mailing list
> Rspec-devel at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-devel

More information about the Rspec-devel mailing list