lib/stationed/generators/plugins/capybara_webkit.rb in stationed-0.0.1 vs lib/stationed/generators/plugins/capybara_webkit.rb in stationed-0.1.0
- old
+ new
@@ -1,9 +1,17 @@
module Stationed
module Generators
module Plugins
module CapybaraWebkit
+ def self.prepended(base)
+ base.class_option :capybara_webkit,
+ type: :boolean,
+ default: true,
+ desc: 'Include CapybaraWebkit for headless browser testing'
+ end
+
def finish_template
+ return super unless options[:capybara] && options[:capybara_webkit]
gem 'capybara-webkit', group: :test
copy_file 'capybara_webkit.rb', 'spec/support/capybara_webkit.rb'
super
end
end