Created
November 26, 2017 20:56
-
-
Save sghiassy/38f69de72c718a376854ca3e589fd59a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Spec: QuickSpec { | |
override func spec() { | |
beforeSuite { | |
print("βοΈ before suite") | |
} | |
afterSuite { | |
print("π after suite") | |
} | |
describe("beforeEach and afterEach behaviour") { | |
beforeEach { | |
print("βοΈ top before each") | |
} | |
context("some context") { | |
beforeEach { | |
print("π context before suite") | |
} | |
it("example 1") { print("π example 1") } | |
it("example 2") { print("π example 2") } | |
it("example 3") { print("π example 3") } | |
beforeSuite { | |
print("π¨π¨π¨ before suite") | |
} | |
afterEach { | |
print("π context after each") | |
} | |
} | |
context("another context") { | |
beforeEach { | |
print("π context before each") | |
} | |
it("example 1") { print("π example 1") } | |
it("example 2") { print("π example 2") } | |
afterEach { | |
print("π context after each") | |
} | |
} | |
afterEach { | |
print("βοΈ top after each") | |
} | |
} | |
} | |
} | |
// OUTPUT | |
``` | |
βοΈ before suite | |
π¨π¨π¨ before suite | |
βοΈ top before each | |
π context before each | |
π example 1 | |
π context after each | |
βοΈ top after each | |
βοΈ top before each | |
π context before each | |
π example 2 | |
π context after each | |
βοΈ top after each | |
βοΈ top before each | |
π context before suite | |
π example 1 | |
π context after each | |
βοΈ top after each | |
βοΈ top before each | |
π context before suite | |
π example 2 | |
π context after each | |
βοΈ top after each | |
βοΈ top before each | |
π context before suite | |
π example 3 | |
π context after each | |
βοΈ top after each | |
π after suite | |
``` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment