Class: PagesCore::Generators::RspecGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Defined in:
lib/rails/generators/pages_core/rspec/rspec_generator.rb

Instance Method Summary collapse

Instance Method Details

#setup_development_gemsObject


7
8
9
10
11
# File 'lib/rails/generators/pages_core/rspec/rspec_generator.rb', line 7

def setup_development_gems
  gem_group :development do
    gem "spring-commands-rspec"
  end
end

#setup_rspecObject


24
25
26
27
28
29
30
31
32
# File 'lib/rails/generators/pages_core/rspec/rspec_generator.rb', line 24

def setup_rspec
  create_file File.join(".rspec"), "--colour"
  create_file File.join("spec/controllers/.keep")
  create_file File.join("spec/factories/.keep")
  create_file File.join("spec/models/.keep")
  template "spec_helper.rb", File.join("spec/spec_helper.rb")
  template "factories.rb", File.join("spec/support/factories.rb")
  template "mailer_macros.rb", File.join("spec/support/mailer_macros.rb")
end

#setup_test_gemsObject


13
14
15
16
17
18
19
20
21
22
# File 'lib/rails/generators/pages_core/rspec/rspec_generator.rb', line 13

def setup_test_gems
  gem_group :test, :development do
    gem "rspec-rails"
    gem "shoulda-matchers", require: false
    gem "json_spec"
    gem "capybara"
    gem "timecop"
    gem "factory_bot_rails"
  end
end