Module: InertiaRails::RSpec::DeprecatedMatchers Deprecated
- Defined in:
- lib/inertia_rails/rspec/deprecated.rb
Overview
Deprecated.
Will be removed in InertiaRails 4.0
Class Method Summary collapse
Class Method Details
.install! ⇒ Object
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 |
# File 'lib/inertia_rails/rspec/deprecated.rb', line 38 def self.install! ::RSpec::Matchers.define :include_props do |expected| match do |inertia| InertiaRails.deprecator.warn( '`include_props` is deprecated and will be removed in InertiaRails 4.0, use `have_props` instead.' ) @result = InertiaRails::Testing::Assertions.validate_partial_match(inertia, :props, expected) @result[:passed] end { @result[:message] } { @result[:negated_message] } end ::RSpec::Matchers.define :include_view_data do |expected| match do |inertia| InertiaRails.deprecator.warn( '`include_view_data` is deprecated and will be removed in InertiaRails 4.0, use `have_view_data` instead.' ) @result = InertiaRails::Testing::Assertions.validate_partial_match(inertia, :view_data, expected) @result[:passed] end { @result[:message] } { @result[:negated_message] } end end |