Skip to content

Commit

Permalink
add test for Attach
Browse files Browse the repository at this point in the history
  • Loading branch information
agourlay committed Jan 18, 2025
1 parent 93325aa commit 65f0f54
Showing 1 changed file with 20 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,26 @@ class MacroErrorSpec extends FunSuite {
assert(Foo.feature.scenarios.head.steps.size == 3, "size is " + Foo.feature.scenarios.head.steps.size)
}

test("macro compiles and includes nested steps") {

object Foo extends BaseFeature with CoreDsl {

val feature =
Feature("foo") {
Scenario("aaa") {
print_step("Hello world!")
AttachAs("nested steps") {
print_step("Hello world!")
print_step("Hello world!")
}
}
}
}

assert(Foo.feature.scenarios.head.steps.size == 2, "size is " + Foo.feature.scenarios.head.steps.size)
assert(Foo.feature.scenarios.head.steps.map(_.title) == List("print step", "nested steps"))
}

test("macro compiles and includes multiple steps as a seq (literal)") {

object Foo extends BaseFeature with CoreDsl {
Expand Down

0 comments on commit 65f0f54

Please sign in to comment.