Sha256: 0c2cdaafc50138e142ecbfbc095a0b432f06f10ffd59d068e1135b76015a2726

Contents?: true

Size: 566 Bytes

Versions: 3

Compression:

Stored size: 566 Bytes

Contents

require_relative "base"

module Flame
  class TestingGenerator < Generators::Base
    def install_rspec
      generate("rspec:install")
    end

    def import_spec_support
      inject_into_file(
        "spec/rails_helper.rb",
        "Dir[Rails.root.join('spec/support/**/*.rb')].each { |f| require f }\n",
        before: "RSpec.configure do |config|\n"
      )
    end

    def support_template
      template("spec/support/shoulda_matchers.rb")
      template("spec/support/factory_bot.rb")
      template("spec/support/database_cleaner.rb")
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
flamerb-0.3.0 lib/flame/generators/testing_generator.rb
flamerb-0.2.0 lib/flame/generators/testing_generator.rb
flamerb-0.1.3 lib/flame/generators/testing_generator.rb