Module: RSpec::Rails::FeatureCheck Private
- Defined in:
- lib/rspec/rails/feature_check.rb
Overview
This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.
Disable some cops until https://github.com/bbatsov/rubocop/issues/1310 rubocop:disable Style/IndentationConsistency
Class Method Summary collapse
-
.can_check_pending_migrations? ⇒ Boolean
private
rubocop:enable Style/IndentationWidth.
- .can_maintain_test_schema? ⇒ Boolean private
- .has_1_9_hash_syntax? ⇒ Boolean private
- .has_action_mailer? ⇒ Boolean private
- .has_action_mailer_preview? ⇒ Boolean private
- .has_active_job? ⇒ Boolean private
- .has_active_record? ⇒ Boolean private
- .has_active_record_migration? ⇒ Boolean private
- .type_metatag(type) ⇒ Object private
Class Method Details
.can_check_pending_migrations? ⇒ Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
rubocop:enable Style/IndentationWidth
11 12 13 14 |
# File 'lib/rspec/rails/feature_check.rb', line 11 def can_check_pending_migrations? has_active_record_migration? && ::ActiveRecord::Migration.respond_to?(:check_pending!) end |
.can_maintain_test_schema? ⇒ Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
16 17 18 19 |
# File 'lib/rspec/rails/feature_check.rb', line 16 def can_maintain_test_schema? has_active_record_migration? && ::ActiveRecord::Migration.respond_to?(:maintain_test_schema!) end |
.has_1_9_hash_syntax? ⇒ Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
41 42 43 |
# File 'lib/rspec/rails/feature_check.rb', line 41 def has_1_9_hash_syntax? ::Rails::VERSION::STRING > '4.0' end |
.has_action_mailer? ⇒ Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
33 34 35 |
# File 'lib/rspec/rails/feature_check.rb', line 33 def has_action_mailer? defined?(::ActionMailer) end |
.has_action_mailer_preview? ⇒ Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
37 38 39 |
# File 'lib/rspec/rails/feature_check.rb', line 37 def has_action_mailer_preview? has_action_mailer? && defined?(::ActionMailer::Preview) end |
.has_active_job? ⇒ Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
21 22 23 |
# File 'lib/rspec/rails/feature_check.rb', line 21 def has_active_job? defined?(::ActiveJob) end |
.has_active_record? ⇒ Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
25 26 27 |
# File 'lib/rspec/rails/feature_check.rb', line 25 def has_active_record? defined?(::ActiveRecord) end |
.has_active_record_migration? ⇒ Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
29 30 31 |
# File 'lib/rspec/rails/feature_check.rb', line 29 def has_active_record_migration? has_active_record? && defined?(::ActiveRecord::Migration) end |
.type_metatag(type) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
45 46 47 48 49 50 51 |
# File 'lib/rspec/rails/feature_check.rb', line 45 def (type) if has_1_9_hash_syntax? "type: :#{type}" else ":type => :#{type}" end end |