Sha256: 89deee12c02bdce67d31a1f523c6f21ff3181170137b29adb566f61d62806f86
Contents?: true
Size: 860 Bytes
Versions: 12
Compression:
Stored size: 860 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 uncomment_lines cli.uncomment_lines "#{gem_name}/Rakefile", /require.+rspec.+/ cli.uncomment_lines "#{gem_name}/Rakefile", /RSpec.+/ end def install_templates template "#{rspec_root}/spec_helper.rb.tt" install_rails_helper template "#{rspec_root}/support/shared_contexts/temp_dir.rb.tt" end def rspec_root "%gem_name%/spec" end def install_rails_helper return unless configuration.dig :generate, :engine template "#{rspec_root}/rails_helper.rb.tt" end end end end
Version data entries
12 entries across 12 versions & 1 rubygems