-
Notifications
You must be signed in to change notification settings - Fork 49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cucumber support #16
Comments
Thanks for those notes, definitely helpful - just to confirm, are you using just straight cucumber, or cucumber-rails? |
using cucumber-rails gave me some error which I had trouble tracking down (and forgot right now), will post later. so just using plain cucumber. |
Oh, actually the error was simply "no such file to load -- (...)/config/environment (LoadError)". So probably I could have fixed it by creating that file and loading my engine. However, I consider it a bad idea cluttering up my source tree with circumstantial requirements like that, which don't have some legitimate use. Maybe I could have saved a few lines above though, by doing so. |
The following code will use config.ru to initialize the app (like Bundler.require :default, :test
require 'my_engine'
require 'capybara/cucumber'
World(Capybara::RSpecMatchers)
World(Capybara::DSL)
Capybara.save_and_open_page_path = 'tmp/capybara'
combustion_rack_builder = eval "Rack::Builder.new {( " + File.read(File.dirname(__FILE__) + '/../../config.ru') + "\n )}"
Capybara.app = combustion_rack_builder.to_app
World{Capybara.app.routes.url_helpers} |
There are a few things required to make Cucumber play nicely.
I'm using this issue to document the steps I had to take to make it work.
Maybe this will lead to a patch in the future :)
in env.rb:
The text was updated successfully, but these errors were encountered: