Reputation: 778
I'm developing a sinatra app, and I'd like to test it using cucumber and watir. My problem is that I'm not sure how to set up my env.rb
file to run the sinatra app, all the examples I've found use webrat or capybara or something else that isn't watir. Is there a way to start my sinatra app from cucumber without using webrat or another testing framework that isn't watir, or should I just start my sinatra app manually before running my tests?
Upvotes: 1
Views: 648
Reputation: 1556
env.rb executes an arbitrary Ruby code as a part of Cucumber setup, so you should be able to start your app or do whatever else you need. Try:
require 'YourApp'
YourApp.run!
Having said that, it might not be the most logical place to do. An automated build cycle for a web app usually consists of the following steps:
Cucumber and Watir are all about Step 4; therefore, env.rb usually starts a browser. What you are trying to do belongs logically in Step 3, IMHO.
Upvotes: 1