-
Notifications
You must be signed in to change notification settings - Fork 5
How It Works
Jon Wagner edited this page Mar 20, 2013
·
2 revisions
Regardless of the style of tests that you create, there are 4 types of test code:
- Group (TestFixture, Describing, Given, etc.)
- Case (TestCase, It)
- Setup
- TearDown
For a Group, PSate will do the following:
- Run the script block once per test case or inner group. During each run, PSate will only run one of the inner blocks. PSate uses some module state to manage this process.
- After each test run, any automatic test objects (e.g. New-TestFile) are cleaned up.
Example:
Given "a context" {
"setup"
It "does 1A" {}
"given"
It "does 1B" {}
"teardown"
}
This block will execute as follows:
# first pass for test 1
setup
does 1A
given
teardown
# second pass for test 2
setup
given
does 1B
teardown