Sha256: 79afc77fec9b0254e80ea13f61e4152bfe64ff60b057971147fcbc5190afcd72

Contents?: true

Size: 1.22 KB

Versions: 5

Compression:

Stored size: 1.22 KB

Contents

# frozen_string_literal: true

module PagesCore
  module Generators
    class RspecGenerator < Rails::Generators::Base
      desc "RSpec setup"
      source_root File.expand_path("templates", __dir__)

      def setup_test_gems
        gem_group :development, :test do
          gem "capybara"
          gem "factory_bot_rails"
          gem "fuubar"
          gem "json_spec"
          gem "rspec-rails"
          gem "rspec_junit_formatter"
          gem "selenium-webdriver"
          gem "shoulda-matchers", require: false
          gem "simplecov", require: false
        end
      end

      def setup_rspec
        create_file File.join(".rspec"), "--format Fuubar\n--colour\n" \
                                         "--require spec_helper"
        create_file File.join("spec/mailers/preview/.keep")
        create_file File.join("spec/models/.keep")
        create_file File.join("spec/system/.keep")
        template "spec_helper.rb", File.join("spec/spec_helper.rb")
        template "rails_helper.rb", File.join("spec/rails_helper.rb")
        template "factories.rb", File.join("spec/factories.rb")
        template("page_templates_spec.rb",
                 File.join("spec/system/page_templates_spec.rb"))
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
pages_core-3.15.5 lib/rails/generators/pages_core/rspec/rspec_generator.rb
pages_core-3.15.4 lib/rails/generators/pages_core/rspec/rspec_generator.rb
pages_core-3.15.3 lib/rails/generators/pages_core/rspec/rspec_generator.rb
pages_core-3.15.2 lib/rails/generators/pages_core/rspec/rspec_generator.rb
pages_core-3.15.1 lib/rails/generators/pages_core/rspec/rspec_generator.rb