lib/flame/generators/testing_generator.rb in flamerb-0.1.2 vs lib/flame/generators/testing_generator.rb in flamerb-0.1.3
- old
+ new
@@ -4,9 +4,20 @@
class TestingGenerator < Generators::Base
def install_rspec
generate("rspec:install")
end
- def install_gems
+ def import_spec_support
+ inject_into_file(
+ "spec/rails_helper.rb",
+ "Dir[Rails.root.join('spec/support/**/*.rb')].each { |f| require f }\n",
+ before: "RSpec.configure do |config|\n"
+ )
+ end
+
+ def support_template
+ template("spec/support/shoulda_matchers.rb")
+ template("spec/support/factory_bot.rb")
+ template("spec/support/database_cleaner.rb")
end
end
end