Module: Ruact::Testing

Defined in:
lib/ruact/testing/flight_wire_parser.rb,
lib/ruact/testing.rb,
lib/ruact/testing/component_query.rb,
lib/ruact/testing/flight_extractor.rb,
lib/ruact/testing/flight_structure_diff.rb

Overview

Public, host-app-facing test-support surface (FR108, Story 15.4). Loaded ONLY by an explicit require "ruact/testing" (or one of the files under ruact/testing/) — never by require "ruact", so a production boot carries no RSpec/test dependency. The pure wire parser + structural diff engine live here as the SINGLE shipped implementation shared by both the public have_ruact_component matcher and the gem's internal Ruact::Spec::* matchers (promoted from spec/support in Story 15.4 — wrap, not fork).

Defined Under Namespace

Modules: FlightExtractor Classes: ComponentQuery, FlightStructureDiff, FlightWireParseError, FlightWireParser, NotAFlightResponseError

Class Method Summary collapse

Class Method Details

.props_match?(expected, actual_props) ⇒ Boolean

Compares a rendered instance's serialized props against the value passed to .with_props. A plain Hash requires exact equality (via ===, i.e. ==); an RSpec argument matcher (hash_including, including, a_hash_…) drives subset/fuzzy semantics through its own #===.

Returns:

  • (Boolean)


39
40
41
42
43
# File 'lib/ruact/testing.rb', line 39

def self.props_match?(expected, actual_props)
  # rubocop:disable Style/CaseEquality -- intentional: lets RSpec matchers (hash_including, …) drive semantics via #===.
  expected === actual_props
  # rubocop:enable Style/CaseEquality
end