Brandon Olivares
2010-Jun-29 02:58 UTC
[rspec-users] Using RSpec and Cucumber with Rails 3 Engines
Hi, I recently upgraded to Rails 3 beta, a few weeks ago. One thing I would really like to do is to develop components of my application, because some of them I''d really like to be able to reuse on other projects. I know how to make engines well enough, but it seems difficult or impossible to test them with RSpec and Cucumber. At least with Cucumber, it won''t run because it''s not a normal Rails application. Is there a way to get around this, or what alternative would you recommend? Thanks, Brandon
aslak hellesoy
2010-Jun-29 05:54 UTC
[rspec-users] Using RSpec and Cucumber with Rails 3 Engines
On Tue, Jun 29, 2010 at 4:58 AM, Brandon Olivares <programmer2188 at gmail.com> wrote:> Hi, > > I recently upgraded to Rails 3 beta, a few weeks ago. One thing I would > really like to do is to develop components of my application, because some > of them I''d really like to be able to reuse on other projects. I know how to > make engines well enough, but it seems difficult or impossible to test them > with RSpec and Cucumber. At least with Cucumber, it won''t run because it''s > not a normal Rails application. > > Is there a way to get around this, or what alternative would you recommend? >Have a test app that uses your engine, and that has cucumber and rspec tests. Aslak> Thanks, > Brandon > > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users >
Matt Wynne
2010-Jun-29 15:59 UTC
[rspec-users] Using RSpec and Cucumber with Rails 3 Engines
On 29 Jun 2010, at 06:54, aslak hellesoy wrote:> On Tue, Jun 29, 2010 at 4:58 AM, Brandon Olivares > <programmer2188 at gmail.com> wrote: >> Hi, >> >> I recently upgraded to Rails 3 beta, a few weeks ago. One thing I would >> really like to do is to develop components of my application, because some >> of them I''d really like to be able to reuse on other projects. I know how to >> make engines well enough, but it seems difficult or impossible to test them >> with RSpec and Cucumber. At least with Cucumber, it won''t run because it''s >> not a normal Rails application. >> >> Is there a way to get around this, or what alternative would you recommend? >> > > Have a test app that uses your engine, and that has cucumber and rspec tests. > > AslakA good example of an engine tested with Cucumber is: http://github.com/21croissants/courgette There''s a rails app in fixtures_rails_root. Check out the neat trick in the config/environment.rb[1] to load the engine from wherever you want. [1] http://github.com/21croissants/courgette/blob/master/fixture_rails_root/config/environment.rb> >> Thanks, >> Brandon >> >> _______________________________________________ >> rspec-users mailing list >> rspec-users at rubyforge.org >> http://rubyforge.org/mailman/listinfo/rspec-users >> > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users