Sha256: eecc5039a7cf28c8f9ecbeebb228881e52a79b9533d3211bed1204df93f41d56

Contents?: true

Size: 1.03 KB

Versions: 22

Compression:

Stored size: 1.03 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)
      end

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

      def has_action_mailbox?
        defined?(::ActionMailbox)
      end

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

Version data entries

22 entries across 20 versions & 4 rubygems

Version Path
scrapbook-0.3.2 vendor/ruby/2.7.0/gems/rspec-rails-5.1.2/lib/rspec/rails/feature_check.rb
scrapbook-0.3.2 vendor/ruby/2.7.0/gems/rspec-rails-5.1.1/lib/rspec/rails/feature_check.rb
scrapbook-0.3.1 vendor/ruby/2.7.0/gems/rspec-rails-5.1.2/lib/rspec/rails/feature_check.rb
scrapbook-0.3.1 vendor/ruby/2.7.0/gems/rspec-rails-5.1.1/lib/rspec/rails/feature_check.rb
rspec-rails-5.1.2 lib/rspec/rails/feature_check.rb
rspec-rails-5.1.1 lib/rspec/rails/feature_check.rb
rspec-rails-5.1.0 lib/rspec/rails/feature_check.rb
rspec-rails-5.0.3 lib/rspec/rails/feature_check.rb
date_n_time_picker_activeadmin-0.1.2 vendor/bundle/ruby/2.6.0/gems/rspec-rails-5.0.2/lib/rspec/rails/feature_check.rb
date_n_time_picker_activeadmin-0.1.1 vendor/bundle/ruby/2.6.0/gems/rspec-rails-5.0.2/lib/rspec/rails/feature_check.rb
rspec-rails-5.0.2 lib/rspec/rails/feature_check.rb
rails_mini_profiler-0.2.0 vendor/bundle/ruby/3.0.0/gems/rspec-rails-4.1.2/lib/rspec/rails/feature_check.rb
rspec-rails-5.0.1 lib/rspec/rails/feature_check.rb
rspec-rails-4.1.2 lib/rspec/rails/feature_check.rb
rspec-rails-5.0.0 lib/rspec/rails/feature_check.rb
rspec-rails-4.1.1 lib/rspec/rails/feature_check.rb
rspec-rails-4.1.0 lib/rspec/rails/feature_check.rb
rspec-rails-4.0.2 lib/rspec/rails/feature_check.rb
rspec-rails-4.0.1 lib/rspec/rails/feature_check.rb
rspec-rails-4.0.0 lib/rspec/rails/feature_check.rb