File: helper_generator.rb

package info (click to toggle)
ruby-rspec-rails 8.0.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,804 kB
  • sloc: ruby: 10,881; sh: 198; makefile: 6
file content (16 lines) | stat: -rw-r--r-- 380 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
require 'generators/rspec'

module Rspec
  module Generators
    # @private
    class HelperGenerator < Base
      class_option :helper_specs, type: :boolean, default: true

      def generate_helper_spec
        return unless options[:helper_specs]

        template 'helper_spec.rb', target_path('helpers', class_path, "#{file_name}_helper_spec.rb")
      end
    end
  end
end