I\'m trying to do BDD on a Google App Script. I understand that in principle I should be able to use some combination of Cucumber, Capybara and Mechanize to do BDD on a non
If you are not using Rails, set Capybara.app to your rack app:
It was meant to be read as:
If the application that you are testing is a Rack app, but not Rails, set Capybara.app to your Rack app:
Capybara's README was updated as the result of this question.
As you want to run tests against external application, you should set Capybara.app_host
instead of Capybara.app
.
I haven't used capybara-mechanize but I think it may be not the best driver to use to test external non-Rack application. Mechanize inherits from Racktest and Racktest is for testing apps with Rack interface (mostly Rails). If your app doesn't have Rack interface, then capybara-mechanize may be not the best choice.
I recommend you to use the built-in selenium, poltergeist, capybara-webkit or terminus
Also your code can be written a bit nicer using Capybara.configure
:
Capybara.configure do |config|
config.run_server = false
config.default_driver = :selenium
config.app_host = 'https://www.google.com' # change url
end
From Jeroen van Dijk on this Google group message, just set your Capybara.app to something that evaluates to true. i.e.
Capybara.app = "make sure this isn't nil"
As long as Capybara.run_server is set to false, it will not ever try to boot the app. It is working thus far for me.