Class: EffectiveTestBot::Generators::InstallGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Includes:
Rails::Generators::Migration
Defined in:
lib/generators/effective_test_bot/install_generator.rb

Instance Method Summary collapse

Instance Method Details

#copy_initializerObject



16
17
18
# File 'lib/generators/effective_test_bot/install_generator.rb', line 16

def copy_initializer
  template ('../' * 3) +  'config/effective_test_bot.rb', 'config/initializers/effective_test_bot.rb'
end

#install_minitestObject



10
11
12
13
14
# File 'lib/generators/effective_test_bot/install_generator.rb', line 10

def install_minitest
  return if File.exist?('test/test_helper.rb')
  puts '[effective_test_bot] installing minitest'
  run 'bundle exec rails generate minitest:install'
end

#overwrite_minitestObject



20
21
22
# File 'lib/generators/effective_test_bot/install_generator.rb', line 20

def overwrite_minitest
  template ('../' * 3) +  'config/test_helper.rb', 'test/test_helper.rb'
end

#thank_youObject



24
25
26
27
28
29
# File 'lib/generators/effective_test_bot/install_generator.rb', line 24

def thank_you
  puts "Thanks for using EffectiveTestBot"
  puts "Make sure you create a user in your db/seeds.rb, test/fixtures/users.yml, or test/fixtures/seeds.rb"
  puts "Run `rails test:bot:environment` once to ensure the testing environment is correctly configured"
  puts "Test your app with 'rails test:bot'"
end