// Fixture as receiver context("key turned") { before { controlPanel.turnKey() } test("light is on") { assertTrue(controlPanel.warningLightOn) } test("launches when pressing button") { controlPanel.pressButton() assertFalse(beeped) assertTrue(launched) } } // Fixture as parameter context("key turned") { before2 { fixture -> fixture.controlPanel.turnKey() } test2("light is on") { fixture -> assertTrue(fixture.controlPanel.warningLightOn) } test2("launches when pressing button") { fixture -> fixture.controlPanel.pressButton() assertFalse(fixture.beeped) assertTrue(fixture.launched) } }