← Graph

Test Bench Fixture

concept 5 connections

Test Bench's central abstraction and its most novel capability. A fixture is just a plain Ruby class that includes the `TestBench::Fixture` module and typically exposes a `call` method — there is no special matcher API. Because the Test Bench DSL operates in isolation from the framework, a fixture inherits full access to context, test, assert, refute, indentation, and output methods, and can itself be tested (you can prove it passes when it should and fails when it should). Fixtures compose: higher-level fixtures invoke lower-level ones (e.g. a schema-equality fixture reused by a message-handler fixture comparing events). The name comes from Kent Beck's 1989 Smalltalk xUnit writeup — a behavioral 'device for testing something' — not from Rails/Active Record YAML fixtures. Ladd uses the light-fixture metaphor: a fixture powers and holds the thing being tested. Fixtures let teams build exactly the verification tool they need (e.g. nokogiri+CSS-selector XML assertions, JSON attribute inspection, entity comparisons) rather than relying on general-purpose matcher DSLs.

category
pattern
about
Test Bench Fixture concept
Introduces fixtures as Test Bench's novel composable test-object abstraction.
about
Test Bench Fixture concept
Asks for a definition of the fixture concept in Test Bench.
about
Test Bench Fixture concept
Answer: build specialized fixtures (CSS-selector XML, JSON attribute, Nth-element) rather than general-purpose matchers.
about
Test Bench Fixture concept
Fixtures are the mechanism enabling test-code composition and layering.
concept Test Bench Fixture
related_to
TestBench tool
Fixture is Test Bench's central abstraction, enabled by the DSL being usable in isolation from the framework.

Provenance

Read by
2 extractions