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



32
33
34
# File 'lib/generators/effective_test_bot/install_generator.rb', line 32

def copy_initializer
  template "effective_test_bot.rb", "config/initializers/effective_test_bot.rb"
end

#explain_overwriteObject



16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/generators/effective_test_bot/install_generator.rb', line 16

def explain_overwrite
  puts '[effective_test_bot] Successfully installed/detected: minitest'
  puts ""
  puts 'Starting effective_test_bot specific installation tasks:'
  puts ""
  puts "You will be prompted to overwrite the default minitest configuration"
  puts "files with those packaged inside the effective_test_bot gem."
  puts ""
  puts "If you have very specific existing minitest configuration,"
  puts "you should ensure it's under version control so you can revert if needed"
  puts ""
  puts "Otherwise, press 'Y' to all the following prompts to automatically configure"
  puts "minitest-rails and capybara-webkit based effective_test_bot test coverage"
  puts ""
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.exists?('test/test_helper.rb')
  puts '[effective_test_bot] installing minitest'
  run 'bundle exec rails generate minitest:install'
end

#overwrite_minitestObject



36
37
38
# File 'lib/generators/effective_test_bot/install_generator.rb', line 36

def overwrite_minitest
  template 'test_helper.rb', 'test/test_helper.rb'
end

#thank_youObject



40
41
42
43
44
45
# File 'lib/generators/effective_test_bot/install_generator.rb', line 40

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 `rake test:bot:environment` once to ensure the testing environment is correctly configured"
  puts "Test your app with 'rake test:bot'"
end