Sha256: f677e9cff0c5e961ee1c9b236c93ff9cb5d7703cc51d40e732a8162320dd2801

Contents?: true

Size: 642 Bytes

Versions: 2

Compression:

Stored size: 642 Bytes

Contents

# frozen_string_literal: true

module Gemsmith
  module Generators
    # Generates RSpec support.
    class Rspec < Base
      def run
        return unless configuration.dig(:generate, :rspec)

        cli.template "%gem_name%/lib/tasks/rspec.rake.tt", configuration
        cli.template "#{rspec_root}/spec_helper.rb.tt", configuration
        cli.template("#{rspec_root}/rails_helper.rb.tt", configuration) if configuration.dig(:generate, :rails)
        cli.template "#{rspec_root}/support/shared_contexts/temp_dir.rb.tt", configuration
      end

      private

      def rspec_root
        "%gem_name%/spec"
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
gemsmith-8.1.0 lib/gemsmith/generators/rspec.rb
gemsmith-8.0.0 lib/gemsmith/generators/rspec.rb