Skip to content

Latest commit

 

History

History
95 lines (70 loc) · 2.4 KB

README.md

File metadata and controls

95 lines (70 loc) · 2.4 KB

PSate

PSate (pronounced "sate" or "puh-sate"), meaning "to satisfy", is a test runner module for PowerShell.

PSate is part of the PSST PowerShell Suite for Testing:

Examples

(Note: should below is from PShould)

Getting started TDD-style:

TestFixture "Calculator" {
	TestSetup {
		$x = 1
		$y = 2
	}

    TestCase "Adds" {
        $x + $y | Should Be 3
    }

    TestCase "Subtracts" {
        $x - $y | Should Be -1
    }
}

Getting started BDD-style:

Describing "Calculator" {
	Given "1 and 2" {
		TestSetup {
			$x = 1
			$y = 2
		}

        It "Adds" {
            $x + $y | Should Be 3
        }

        It "Subtracts" {
            $x - $y | Should Be -1
        }
    }
}

Auto-tempfile support:

Describing "FileStuff" {
    Given "nothing" {
        It "can create a test file" {
            # create a file
            $file = New-TestFile

            # do something with it

			# automatically cleaned up
        }
    }
}

Features

See the PSate wiki for full documentation.

  • TDD- or BDD-style test cases
  • Setup and TearDown support
  • Run from Invoke-Tests or run individual tests (in ISE or command line)
  • Works with or without PShould or PSMock
  • Records test results, timings and execution stacks.
  • Automatic management of folder, file, or other New-Item objects
  • NUnit-compatible TestResults.xml output
  • Integrates with automated build tools

Getting PSate

You can get PSate a variety of ways:

Credits

PShould was inspired by the great work by the Pester team. See [[PSate v Pester]] for some differences between the two.