Class: HarnessSpecHelperGenerator

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

Instance Method Summary collapse

Instance Method Details

#generate_spec_helperObject



7
8
9
10
11
# File 'lib/generators/harness_spec_helper/harness_spec_helper_generator.rb', line 7

def generate_spec_helper
  copy_file 'base_spec_helper.rb', 'spec/base_spec_helper.rb'
  copy_file 'dotrspec', '.rspec'
  create_file 'spec/support_common/.keep'
end

#generate_spec_helpersObject



13
14
15
16
17
18
19
# File 'lib/generators/harness_spec_helper/harness_spec_helper_generator.rb', line 13

def generate_spec_helpers
  return if spec_type == 'base'
  template template_file, "spec/#{spec_type.underscore.pluralize}_spec_helper.rb"
  create_file "spec/support_#{spec_type.underscore.pluralize}/.keep"
  create_file "spec/#{spec_type.underscore.pluralize}/.keep"
  create_file "app/#{spec_type.underscore.pluralize}/.keep" unless spec_type.underscore.pluralize == 'features'
end