Alex Chaffee wrote:
I often create integration programs in Ruby that utilize ActiveRecord without
the full Rails stack. So I wonder what the best way would be to fully utilize
Cucumber and RSpec for BDD in this context.
1. Should I still include rspec-rails so hopefully at least the Model support
is available?
I'd say no. All you get is "Model.should have(3).records" and
"model.should have(3).errors_on(:attribute)" which is easy enough to
live without or to copy and paste into your world.
2. If so do I need to (or should I) create a similar directory structure to a
Rails app?
No need. I have my models in a "domain" subdirectory and it works just
fine. You need to make sure they're 'require'd since Rails autoload
magic is gone but that's not a big deal.
3. Would it make any sense to use a generator to create the directory structure
if not using views and a web server?
Good Lord, no :-)
Actually I have considered creating/converting these integration applications
as full blown Rails applications since they definitely have a model and
controller aspect and the Rails framework provides so many built-in features
and extensions. But I can’t find a way to run a Rails app without the use of a
server which I really don’t need.
script/runner -e production 'puts User.count'
Eventually it might be desirable that some or all of the integration logic be
exposed as web services and if so perhaps a traditional Rails app deployed on a
server to provide the web services would trump the overhead of requiring a
server.
Check out Sinatra. You can use ActiveRecord inside a minimalist web
server+router without all the Rails baggage.
- A
_______________________________________________
rspec-users mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/rspec-users
Wow you seem to have already been down this path and this is excellent
advice - thanks!!!
_______________________________________________
rspec-users mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/rspec-users