Sha256: 238e222965ab9f1891c98e2ca27f8a4a0431870e94c10630ceb9ae1b42bbc72f
Contents?: true
Size: 852 Bytes
Versions: 17
Compression:
Stored size: 852 Bytes
Contents
# frozen_string_literal: true module Gemsmith module Generators # Generates RSpec support. class Rspec < Base def run return unless configuration.dig(:generate, :rspec) uncomment_lines install_templates end private def rspec_root "%gem_name%/spec" end def uncomment_lines cli.uncomment_lines "#{gem_name}/Rakefile", /require.+rspec.+/ cli.uncomment_lines "#{gem_name}/Rakefile", /RSpec.+/ end def install_templates cli.template "#{rspec_root}/spec_helper.rb.tt", configuration if configuration.dig(:generate, :rails) cli.template("#{rspec_root}/rails_helper.rb.tt", configuration) end cli.template "#{rspec_root}/support/shared_contexts/temp_dir.rb.tt", configuration end end end end
Version data entries
17 entries across 17 versions & 1 rubygems