Sha256: a489964f79679f906ae58989cc6f91a2f2c28a49f7073e0d9e766a488b3b93ba

Contents?: true

Size: 343 Bytes

Versions: 8

Compression:

Stored size: 343 Bytes

Contents

# frozen_string_literal: true

module Rspec
  module Generators
    class PolicyGenerator < ::Rails::Generators::NamedBase
      source_root File.expand_path("templates", __dir__)

      def create_policy_spec
        template "policy_spec.rb", File.join("spec/policies", class_path, "#{file_name}_policy_spec.rb")
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 2 rubygems

Version Path
pundit-2.4.0 lib/generators/rspec/policy_generator.rb
cm-admin-1.5.22 vendor/bundle/ruby/3.3.0/gems/pundit-2.2.0/lib/generators/rspec/policy_generator.rb
cm-admin-1.5.21 vendor/bundle/ruby/3.3.0/gems/pundit-2.2.0/lib/generators/rspec/policy_generator.rb
cm-admin-1.5.20 vendor/bundle/ruby/3.3.0/gems/pundit-2.2.0/lib/generators/rspec/policy_generator.rb
pundit-2.3.1 lib/generators/rspec/policy_generator.rb
pundit-2.3.0 lib/generators/rspec/policy_generator.rb
pundit-2.2.0 lib/generators/rspec/policy_generator.rb
pundit-2.1.1 lib/generators/rspec/policy_generator.rb