Sha256: 07367f4248e8d69a1ab2c549ec01f6cc71d6be67f1b658982f2a83cbc3af4182

Contents?: true

Size: 1.14 KB

Versions: 1

Compression:

Stored size: 1.14 KB

Contents

module RSpec
  module Rails
    # @private
    module FeatureCheck
      module_function
      def has_active_job?
        defined?(::ActiveJob)
      end

      def has_active_record?
        defined?(::ActiveRecord)
      end

      def has_active_record_migration?
        has_active_record? && defined?(::ActiveRecord::Migration)
      end

      def has_action_mailer?
        defined?(::ActionMailer)
      end

      def has_action_mailer_preview?
        has_action_mailer? && defined?(::ActionMailer::Preview)
      end

      def has_action_cable_testing?
        defined?(::ActionCable) && ActionCable::VERSION::MAJOR >= 6
      end

      def has_action_mailer_parameterized?
        has_action_mailer? && defined?(::ActionMailer::Parameterized::DeliveryJob)
      end

      def has_action_mailer_unified_delivery?
        has_action_mailer? && defined?(::ActionMailer::MailDeliveryJob)
      end

      def has_action_mailer_legacy_delivery_job?
        defined?(ActionMailer::DeliveryJob)
      end

      def has_action_mailbox?
        defined?(::ActionMailbox)
      end

      def type_metatag(type)
        "type: :#{type}"
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rspec-rails-6.0.0.rc1 lib/rspec/rails/feature_check.rb