Module: Generapp::Actions::Test

Included in:
Generapp::AppBuilder
Defined in:
lib/generapp/actions/test.rb

Overview

App test environment associated actions

Instance Method Summary collapse

Instance Method Details

#configure_ciObject



45
46
47
# File 'lib/generapp/actions/test.rb', line 45

def configure_ci
  copy_file 'circle.yml', 'circle.yml'
end

#configure_coverageObject



41
42
43
# File 'lib/generapp/actions/test.rb', line 41

def configure_coverage
  copy_file 'simplecov', '.simplecov'
end

#configure_rspecObject



10
11
12
13
14
# File 'lib/generapp/actions/test.rb', line 10

def configure_rspec
  remove_file 'spec/rails_helper.rb'
  copy_file 'spec/rails_helper.rb',
            'spec/rails_helper.rb'
end

#enable_database_cleanerObject



16
17
18
19
# File 'lib/generapp/actions/test.rb', line 16

def enable_database_cleaner
  copy_file 'spec/database_cleaner.rb',
            'spec/support/database_cleaner.rb'
end

#enable_devise_testsObject



21
22
23
24
# File 'lib/generapp/actions/test.rb', line 21

def enable_devise_tests
  copy_file 'spec/devise.rb',
            'spec/support/devise.rb'
end

#generate_rspecObject



6
7
8
# File 'lib/generapp/actions/test.rb', line 6

def generate_rspec
  generate 'rspec:install'
end

#provide_shoulda_matchers_configObject



26
27
28
29
# File 'lib/generapp/actions/test.rb', line 26

def provide_shoulda_matchers_config
  copy_file 'spec/shoulda_matchers_config.rb',
            'spec/support/shoulda_matchers.rb'
end

#spec_foldersObject



31
32
33
34
35
36
37
38
39
# File 'lib/generapp/actions/test.rb', line 31

def spec_folders
  %w(spec/lib spec/controllers
     spec/helpers
     spec/support/matchers
     spec/support/mixins
     spec/support/shared_examples).each do |dir|
    empty_directory_with_keep_file dir
  end
end