Hey, in the Spek 1.x I used to chain mutiple `give...
# spek
s
Hey, in the Spek 1.x I used to chain mutiple
given
to describe the context. I had a look at the migration steps on https://spekframework.org/migration/#given-on-it it feels like the
Given
in the
Scenario
is the equivalent of the `given`(s) but it doesn’t seem like I can chain them. Am i correct ?
I guess I could go for
Copy code
group{
    group{
        group{
            test{}
            test{}
        }
    }
}
r
Why not use the specification style?
describe/context/it
s
with
describe/context/it
you can have nested describe or context but the it seems weird as it encapsulates the
when
and the
test
cf one of the example :
Copy code
it("should throw when first is invoked") {
				assertFailsWith(NoSuchElementException::class) {
					set.first()
				}
			}
r
hmm, how would you translate that to
given/when/then
if nesting is allowed?
s
when("first is invoked")
it("should throw")
r
@sebastien.rouif sorry for the late reply. How about
context('when first is invoked')
?
s
I’m just puzzled by the naming,
when
is not really a context anymore it’s an
action
I really liked the approach of Spek1 which also forced you to do assertions after the action