You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was going through the docs and came up on something in the Mental model .
This is the code layout used as an example in the section:
var_=Describe("Books", func() {
varbook*books.BookBeforeEach(func() {
//Closure Abook=&books.Book{
Title: "Les Miserables",
Author: "Victor Hugo",
Pages: 2783,
}
Expect(book.IsValid()).To(BeTrue())
})
Describe("Extracting names", func() {
When("author has both names", func() {
It("extracts the last name", func() {
//Closure BExpect(book.AuthorLastName()).To(Equal("Hugo"))
})
It("extracts the first name", func() {
//Closure CExpect(book.AuthorFirstName()).To(Equal("Victor"))
})
})
When("author has one name", func() {
BeforeEach(func() {
//Closure Dbook.Author="Hugo"
})
It("extracts the last name", func() {
//Closure EExpect(book.AuthorLastName()).To(Equal("Hugo"))
})
It("returns empty first name", func() {
//Closure FExpect(book.AuthorFirstName()).To(BeZero())
})
})
})
})
And it goes on to say:
"We could represent the spec tree that Ginkgo generates as follows:"
Describe: "Books"
|_BeforeEach: <Closure-A>
|_Describe: "Extracting names"
|_When: "author has both names"
|_It: "extracts the last name", <Closure-B>
|_It: "extracts the first name", <Closure-C>
|_When: "author has one name"
|_BeforeEach: <Closure-D>
|_It: "extracts the last name", <Closure-E>
|_It: "returns empty first name", <Closure-F>
Shouldn’t it be that the When nodes are subnodes of the second Describe? Giving the following spec tree:
Describe: "Books"
|_BeforeEach: <Closure-A>
|_Describe: "Extracting names"
|_When: "author has both names"
|_It: "extracts the last name", <Closure-B>
|_It: "extracts the first name", <Closure-C>
|_When: "author has one name"
|_BeforeEach: <Closure-D>
|_It: "extracts the last name", <Closure-E>
|_It: "returns empty first name", <Closure-F>
The text was updated successfully, but these errors were encountered:
I was going through the docs and came up on something in the Mental model .
This is the code layout used as an example in the section:
And it goes on to say:
"We could represent the spec tree that Ginkgo generates as follows:"
Shouldn’t it be that the
When
nodes are subnodes of the secondDescribe
? Giving the following spec tree:The text was updated successfully, but these errors were encountered: