Class: Tuberack::Generators::InstallGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- Tuberack::Generators::InstallGenerator
- Defined in:
- lib/generators/tuberack/install_generator.rb
Instance Method Summary collapse
- #capybara_test_help ⇒ Object
- #copy_simplecov ⇒ Object
- #generate_cucumber ⇒ Object
- #simplecov_cucumber ⇒ Object
- #simplecov_test_help ⇒ Object
- #testable_test_help ⇒ Object
Instance Method Details
#capybara_test_help ⇒ Object
37 38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/generators/tuberack/install_generator.rb', line 37 def append_file 'test/test_helper.rb' do "\nrequire 'capybara/rails' # Capybara must be required directly \n\nclass ActionDispatch::IntegrationTest\n include Capybara::DSL\nend\n EOH\n end\nend\n" |
#copy_simplecov ⇒ Object
12 13 14 |
# File 'lib/generators/tuberack/install_generator.rb', line 12 def copy_simplecov template ".simplecov", ".simplecov" end |
#generate_cucumber ⇒ Object
7 8 9 |
# File 'lib/generators/tuberack/install_generator.rb', line 7 def generate_cucumber generate 'cucumber:install' end |
#simplecov_cucumber ⇒ Object
17 18 19 20 21 22 23 24 |
# File 'lib/generators/tuberack/install_generator.rb', line 17 def simplecov_cucumber prepend_file 'features/support/env.rb' do "require 'simplecov'\n\n EOH\n end\nend\n" |
#simplecov_test_help ⇒ Object
27 28 29 30 31 32 33 34 |
# File 'lib/generators/tuberack/install_generator.rb', line 27 def simplecov_test_help prepend_file 'test/test_helper.rb' do "require 'simplecov'\n\n EOH\n end\nend\n" |
#testable_test_help ⇒ Object
51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 |
# File 'lib/generators/tuberack/install_generator.rb', line 51 def testable_test_help append_file 'test/test_helper.rb' do "\nrequire 'tuberack'\n\ninclude Tuberack::Helpers\n EOH\n end\n \n append_file 'test/test_helper.rb' do\n <<-EOH\n\nclass ActiveSupport::TestCase\n # Uncomment if are you using Rails engine\n # include MyEngine::Engine.routes.url_helpers\nend\n EOH\n end\nend\n" |