|
|
|
|
|
by The_Pherocity
4371 days ago
|
|
I wouldn't call this a BDD framework yet. It's speckled with both standard assertions and semantic assertions, and an "It" function that simply takes a block and a string. I can replicate this with using underscores in my test function names and avoid the complexity. Not trying to be a jerk, but what we should be driving for is something closer to: func Describe("The system I want to Test"){
When("I click the red button")
Then("I should see the light turn on")
And("I should see 4 lights")
}
func Step("I click the red button"){
buttons["red"].click
}
func Step("I should see the light turn on"){
lights.on.should().be_true
}
func Step("I should see (\d+) lights"){
lights.count.should().be(4)
}
|
|