File: system_generator.rb

package info (click to toggle)
ruby-rspec-rails 7.1.1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,796 kB
  • sloc: ruby: 11,068; sh: 198; makefile: 6
file content (24 lines) | stat: -rw-r--r-- 509 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
require 'generators/rspec'

module Rspec
  module Generators
    # @private
    class SystemGenerator < Base
      class_option :system_specs, type: :boolean, default: true,  desc: "Generate system specs"

      def generate_system_spec
        return unless options[:system_specs]

        template template_name, target_path('system', class_path, filename)
      end

      def template_name
        'system_spec.rb'
      end

      def filename
        "#{table_name}_spec.rb"
      end
    end
  end
end