Class: Flame::TestingGenerator

Inherits:
Generators::Base show all
Defined in:
lib/flame/generators/testing_generator.rb

Instance Method Summary collapse

Methods inherited from Generators::Base

source_root

Instance Method Details

#import_spec_supportObject



9
10
11
12
13
14
15
# File 'lib/flame/generators/testing_generator.rb', line 9

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

#install_rspecObject



5
6
7
# File 'lib/flame/generators/testing_generator.rb', line 5

def install_rspec
  generate("rspec:install")
end

#support_templateObject



17
18
19
20
21
# File 'lib/flame/generators/testing_generator.rb', line 17

def support_template
  template("spec/support/shoulda_matchers.rb")
  template("spec/support/factory_bot.rb")
  template("spec/support/database_cleaner.rb")
end