File: job_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 (13 lines) | stat: -rw-r--r-- 341 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
require 'generators/rspec'

module Rspec
  module Generators
    # @private
    class JobGenerator < Base
      def create_job_spec
        file_suffix = file_name.end_with?('job') ? 'spec.rb' : 'job_spec.rb'
        template 'job_spec.rb.erb', target_path('jobs', class_path, [file_name, file_suffix].join('_'))
      end
    end
  end
end