How to run spec in a specific order?

26 views
Skip to first unread message

Nguyễn Văn Cao Nguyên

unread,
May 7, 2015, 10:14:37 PM5/7/15
to ginkgo-a...@googlegroups.com
I'm using Agouti with Gomega to write some test, including:
1. User registration.
2. User purchasing an item.
3. User playing with that item.

I think each of them should live in each own "Describe" block and on different file.
And 1 must run before 2 and then 3.
I don't know how to do that, so I repeat a test before other test (and this make the test take longer to finish) like this:
Describe("UserRegistration", fuction() {
  email := "te...@example.com"
  SharedSuccessUserRegistration(email)
})
###
Describe("UserPurchasing", fuction() {
  email := "te...@example.com"
  SharedSuccessUserRegistration(email)
  item := Item{ID:123}
  SharedSuccessUserPurchasing(email, item)
})
###
Describe("UserPlaying", fuction() {
  email := "te...@example.com"
  SharedSuccessUserRegistration(email)
  item := Item{ID:123}
  SharedSuccessUserPurchasing(email, item)
  SharedSuccessUserPlaying(email, item)
})

I have som more test but not realted and need to run them in parallel with these 3 test (just for faster)
Reply all
Reply to author
Forward
0 new messages