jfirebaugh / konacha

Test your Rails application's JavaScript with the mocha test framework and chai assertion library
Other
1.05k stars 117 forks source link

"Require capybara/poltergeist in the configure block": is there a reason for this? #171

Closed jmuheim closed 10 years ago

jmuheim commented 10 years ago

Just out of curiosity: What's the difference between...

Konacha.configure do |config|
  require 'capybara/poltergeist'
  config.driver = :poltergeist
end if defined?(Konacha)

...and...

require 'capybara/poltergeist'
Konacha.configure do |config|
  config.driver = :poltergeist
end if defined?(Konacha)
jfirebaugh commented 10 years ago

With the latter, your application has a production dependency on capybara-poltergeist. With the former, you can put both capybara-poltergeist and konacha in a group :test, :development block in your Gemfile.

jmuheim commented 10 years ago

Thanks for the explanation! Very interesting, didn't think about this. :+1: