lib/stationed/generators/plugins/webmock.rb in stationed-0.0.1 vs lib/stationed/generators/plugins/webmock.rb in stationed-0.1.0

- old
+ new

@@ -1,9 +1,17 @@ module Stationed module Generators module Plugins module Webmock + def self.prepended(base) + base.class_option :webmock, + type: :boolean, + default: true, + desc: 'Install webmock to prevent external HTTP requests in tests' + end + def finish_template + return super unless options[:webmock] gem 'webmock', group: :test copy_file 'webmock.rb', 'spec/support/webmock.rb' super end end