Class: TestUnit::Generators::TMinusGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Defined in:
lib/generators/test_unit/t_minus_generator.rb

Instance Method Summary collapse

Instance Method Details

#copy_view_fileObject



12
13
14
15
# File 'lib/generators/test_unit/t_minus_generator.rb', line 12

def copy_view_file
  template 'view_test.erb', 
    "test/views/prelaunch/new.html.#{options[:template_engine]}_test.rb"
end

#create_view_test_directoryObject



8
9
10
# File 'lib/generators/test_unit/t_minus_generator.rb', line 8

def create_view_test_directory
  empty_directory 'test/views/prelaunch'
end

#include_test_helperObject



17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/generators/test_unit/t_minus_generator.rb', line 17

def include_test_helper
  if File.exists? File.expand_path('test/test_helper.rb', @_source_root)
    append_file 'test/test_helper.rb', "require 't-minus/test_helper'"
  else
    create_file 'test/test_helper.rb', "      ENV['RAILS_ENV'] = 'test'\n      require File.expand_path('../../config/environment', __FILE__)\n      require 'rails/test_help'\n      require 't-minus/test_helper'\n    FILE\n  end\nend\n"