Skip to content

Commit

Permalink
Merge pull request pester#602 from jsoref/spelling
Browse files Browse the repository at this point in the history
Spelling
  • Loading branch information
nohwnd authored Sep 25, 2016
2 parents 630077a + 58f951d commit 6680807
Show file tree
Hide file tree
Showing 20 changed files with 44 additions and 44 deletions.
6 changes: 3 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
- Fixed failure message output of Should BeLike / BeLikeExactly. [GH-497]
- Added some missing information to about_Should help. [GH-519]
- Made -OutputFormat parameter optional, defaulting to NUnitXml. [GH-503]
- Fix error messsage of Should Throw when null input is provided [GH-521]
- Fix error message of Should Throw when null input is provided [GH-521]
- Fix mocking bug on functions that contain certain parameter names (Metadata, etc). [GH-583]

## 3.4.0 (February 29, 2016)
Expand Down Expand Up @@ -62,7 +62,7 @@
- Added -ExclusiveFilter parameter to Assert-MockCalled. Works like -ParameterFilter, except there also must not be any calls to the mocked command which do _not_ match the filter.
- Added the "bin" folder to the PATH environment variable when installing from Chocolatey. Also removed the hard-coded -OutputXml and -Strict parameters from this file; only -EnableExit is always used from the bat file now. [GH-281]
- PassThru object (when used in conjunction with -CodeCoverage) now includes information about Hit commands in addition to Missed commands. [GH-341]
- Improvements to support for mocking advanced fynctions with dynamic parameters. [GH-346]
- Improvements to support for mocking advanced functions with dynamic parameters. [GH-346]
- Fix for PowerShell v2 bug when mocking commands that have an -ArgumentList parameter with validation attributes. [GH-354]
- Fixed stack trace output when the call to Should is in a file other than the file that contains the It block. [GH-358]

Expand Down Expand Up @@ -208,7 +208,7 @@
- Fixed issues when mocking Out-File [GH-71]
- Exposing TestDrive with Get-TestDriveItem [GH-70]
- Fixed bug where mocking Remove-Item caused cleanup to break [GH-68]
- Added -Passthu to Setup to obtain file system object references [GH-69]
- Added -Passthru to Setup to obtain file system object references [GH-69]
- Can assert on exception messages from Throw assertions [GH-58]
- Fixed assertions on empty functions [GH-50]
- Fixed New-Fixture so it creates proper syntax in tests [GH-49]
Expand Down
12 changes: 6 additions & 6 deletions Functions/Assertions/Contain.ps1
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@

function PesterContain($file, $contentExpecation) {
return ((& $SafeCommands['Get-Content'] -Encoding UTF8 $file) -match $contentExpecation)
function PesterContain($file, $contentExpectation) {
return ((& $SafeCommands['Get-Content'] -Encoding UTF8 $file) -match $contentExpectation)
}

function PesterContainFailureMessage($file, $contentExpecation) {
return "Expected: file ${file} to contain {$contentExpecation}"
function PesterContainFailureMessage($file, $contentExpectation) {
return "Expected: file ${file} to contain {$contentExpectation}"
}

function NotPesterContainFailureMessage($file, $contentExpecation) {
return "Expected: file {$file} to not contain ${contentExpecation} but it did"
function NotPesterContainFailureMessage($file, $contentExpectation) {
return "Expected: file {$file} to not contain ${contentExpectation} but it did"
}

2 changes: 1 addition & 1 deletion Functions/Assertions/ContainExactly.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ InModuleScope Pester {
Test-NegativeAssertion (PesterContainExactly "$TestDrive\test.txt" "pESTER")
}

It "returns true if the file contains the specified Unicode content exactyle" {
It "returns true if the file contains the specified Unicode content exactly" {
Test-PositiveAssertion (PesterContainExactly "$TestDrive\test.txt" "")
}
}
Expand Down
12 changes: 6 additions & 6 deletions Functions/Assertions/ContainExactly.ps1
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
function PesterContainExactly($file, $contentExpecation) {
return ((& $SafeCommands['Get-Content'] -Encoding UTF8 $file) -cmatch $contentExpecation)
function PesterContainExactly($file, $contentExpectation) {
return ((& $SafeCommands['Get-Content'] -Encoding UTF8 $file) -cmatch $contentExpectation)
}

function PesterContainExactlyFailureMessage($file, $contentExpecation) {
return "Expected: file ${file} to contain exactly {$contentExpecation}"
function PesterContainExactlyFailureMessage($file, $contentExpectation) {
return "Expected: file ${file} to contain exactly {$contentExpectation}"
}

function NotPesterContainExactlyFailureMessage($file, $contentExpecation) {
return "Expected: file {$file} to not contain exactly ${contentExpecation} but it did"
function NotPesterContainExactlyFailureMessage($file, $contentExpectation) {
return "Expected: file {$file} to not contain exactly ${contentExpectation} but it did"
}

2 changes: 1 addition & 1 deletion Functions/Assertions/Exist.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ InModuleScope Pester {
}

It "returns false for paths do not exist" {
Test-NegativeAssertion (PesterExist "$TestDrive\nonexistant")
Test-NegativeAssertion (PesterExist "$TestDrive\nonexistent")
}

It 'works for path with escaped [ ] characters' {
Expand Down
12 changes: 6 additions & 6 deletions Functions/Assertions/PesterThrow.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,15 @@ InModuleScope Pester {
Describe "Get-DoMessagesMatch" {
It "returns true if the actual message is the same as the expected message" {
$expectedErrorMessage = "expected"
$actualErrorMesage = "expected"
$result = Get-DoMessagesMatch $actualErrorMesage $expectedErrorMessage
$actualErrorMessage = "expected"
$result = Get-DoMessagesMatch $actualErrorMessage $expectedErrorMessage
$result | Should Be $True
}

It "returns false if the actual message is not the same as the expected message" {
$expectedErrorMessage = "some expected message"
$actualErrorMesage = "unexpected"
$result = Get-DoMessagesMatch $actualErrorMesage $expectedErrorMessage
$actualErrorMessage = "unexpected"
$result = Get-DoMessagesMatch $actualErrorMessage $expectedErrorMessage
$result | Should Be $False
}

Expand All @@ -57,9 +57,9 @@ InModuleScope Pester {
}

It "returns true if the expected error is contained in the actual message" {
$actualErrorMesage = "this is a long error message"
$actualErrorMessage = "this is a long error message"
$expectedText = "long error"
$result = Get-DoMessagesMatch $actualErrorMesage $expectedText
$result = Get-DoMessagesMatch $actualErrorMessage $expectedText
$result | Should Be $True
}
}
Expand Down
2 changes: 1 addition & 1 deletion Functions/Assertions/Should.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ InModuleScope Pester {
function PesterTestFailureMessage($v, $e) { return "slime $e $v" }
$shouldArgs = Parse-ShouldArgs Test, 1

It "should return the postive assertion failure message" {
It "should return the positive assertion failure message" {
Get-FailureMessage $shouldArgs 2 | Should Be "slime 1 2"
}
}
Expand Down
2 changes: 1 addition & 1 deletion Functions/InModuleScope.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ function InModuleScope
}
Normally you would not be able to access "PrivateFunction" from
the powershell session, because the module only exported
the PowerShell session, because the module only exported
"PublicFunction". Using InModuleScope allowed this call to
"PrivateFunction" to work successfully.
#>
Expand Down
2 changes: 1 addition & 1 deletion Functions/It.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ In addition to using your own logic to test expectations and throw exceptions,
you may also use Pester's Should command to perform assertions in plain language.
.PARAMETER Name
An expressive phsae describing the expected test outcome.
An expressive phrase describing the expected test outcome.
.PARAMETER Test
The script block that should throw an exception if the
Expand Down
6 changes: 3 additions & 3 deletions Functions/Mock.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ Describe 'When calling Mock on an external script' {

$result = & tempExternalScript.ps1
It 'Should Invoke the mocked script using the command-invocation operator' {
#the command invocation operator is (&). Moved this to comment because it breaks the contionuous builds.
#the command invocation operator is (&). Moved this to comment because it breaks the continuous builds.
#there is issue for this on GH

$result | Should Be 'I am not tempExternalScript.ps1'
Expand Down Expand Up @@ -677,7 +677,7 @@ Describe "When Calling Assert-MockCalled without exactly" {
FunctionUnderTest "one"
FunctionUnderTest "two"

It "Should throw if mock was not called atleast the number of times specified" {
It "Should throw if mock was not called at least the number of times specified" {
$scriptBlock = { Assert-MockCalled FunctionUnderTest 4 }
$scriptBlock | Should Throw "Expected FunctionUnderTest to be called at least 4 times but was called 3 times"
}
Expand Down Expand Up @@ -1340,7 +1340,7 @@ Describe 'When mocking a command with parameters that match internal variable na
}
}

Describe 'Mocking commands with potentially ambigious parameter sets' {
Describe 'Mocking commands with potentially ambiguous parameter sets' {
function SomeFunction
{
[CmdletBinding()]
Expand Down
8 changes: 4 additions & 4 deletions Functions/Mock.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Each module's mock maintains a separate call history and verified status.
The name of the command to be mocked.
.PARAMETER MockWith
A ScriptBlock specifying the behvior that will be used to mock CommandName.
A ScriptBlock specifying the behavior that will be used to mock CommandName.
The default is an empty ScriptBlock.
NOTE: Do not specify param or dynamicparam blocks in this script block.
These will be injected automatically based on the signature of the command
Expand Down Expand Up @@ -108,7 +108,7 @@ Mock Get-ChildItem { return @{FullName = "A_File.TXT"} }
Get-ChildItem $env:temp\me
Here, B_File.TXT will be returned. Even though the filterless mock was created more recently. This illustrates that filterless Mocks are always evaluated last regardlss of their creation order.
Here, B_File.TXT will be returned. Even though the filterless mock was created more recently. This illustrates that filterless Mocks are always evaluated last regardless of their creation order.
.EXAMPLE
Mock Get-ChildItem { return @{FullName = "A_File.TXT"} } -ModuleName MyTestModule
Expand Down Expand Up @@ -218,7 +218,7 @@ about_Mocking
$null = $metadata.Parameters.Remove('OutVariable')
$null = $metadata.Parameters.Remove('OutBuffer')

# Some versions of powershell may include dynamic parameters here
# Some versions of PowerShell may include dynamic parameters here
# We will filter them out and add them at the end to be
# compatible with both earlier and later versions
$dynamicParams = $metadata.Parameters.Values | & $SafeCommands['Where-Object'] {$_.IsDynamic}
Expand Down Expand Up @@ -468,7 +468,7 @@ An optional filter to qualify wich calls should be counted. Only those
calls to the mock whose parameters cause this filter to return true
will be counted.
.PARAMETER ExlusiveFilter
.PARAMETER ExclusiveFilter
Like ParameterFilter, except when you use ExclusiveFilter, and there
were any calls to the mocked command which do not match the filter,
an exception will be thrown. This is a convenient way to avoid needing
Expand Down
2 changes: 1 addition & 1 deletion Functions/New-Fixture.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Describe "New-Fixture" {

Context "Name and Path parameter is specified:" {
#use different fixture names to avoid interference among the test cases
#claning up would be also possible, but difficult if the assertion fails
#cleaning up would be also possible, but difficult if the assertion fails
It "Creates fixture in full Path:" {
$name = "Test-Fixture"
$path = "TestDrive:\full"
Expand Down
2 changes: 1 addition & 1 deletion Functions/New-Fixture.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ function New-Fixture {
}
The script containg the example test .\Clean.Tests.ps1:
The script containing the example test .\Clean.Tests.ps1:
$here = Split-Path -Parent $MyInvocation.MyCommand.Path
$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".")
Expand Down
4 changes: 2 additions & 2 deletions Functions/SetupTeardown.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ function Add-SetupAndTeardownV2
if ($type -eq [System.Management.Automation.PSTokenType]::Command -and
(IsSetupOrTeardownCommand -CommandName $token.Content))
{
$openBraceIndex, $closeBraceIndex = Get-BraceIndecesForCommand -Tokens $tokens -CommandIndex $i
$openBraceIndex, $closeBraceIndex = Get-BraceIndicesForCommand -Tokens $tokens -CommandIndex $i

$block = Get-ScriptBlockFromTokens -Tokens $Tokens -OpenBraceIndex $openBraceIndex -CloseBraceIndex $closeBraceIndex -CodeText $codeText
Add-SetupOrTeardownScriptBlock -CommandName $token.Content -ScriptBlock $block
Expand Down Expand Up @@ -263,7 +263,7 @@ function IsTestGroupCommand
return $CommandName -eq 'BeforeAll' -or $CommandName -eq 'AfterAll'
}

function Get-BraceIndecesForCommand
function Get-BraceIndicesForCommand
{
param (
[System.Management.Automation.PSToken[]] $Tokens,
Expand Down
2 changes: 1 addition & 1 deletion Functions/TestResults.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ InModuleScope Pester {
$description = $xmlTestResult.description
}

$xmlTestResult.type | Should Be "Powershell"
$xmlTestResult.type | Should Be "PowerShell"
$xmlTestResult.name | Should Be "Mocked Describe"
$description | Should BeNullOrEmpty
$xmlTestResult.result | Should Be "Success"
Expand Down
2 changes: 1 addition & 1 deletion Functions/TestResults.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ function Write-NUnitCultureInformation($PesterState, [System.Xml.XmlWriter] $Xml

function Write-NUnitGlobalTestSuiteAttributes($PesterState, [System.Xml.XmlWriter] $XmlWriter, [switch] $LegacyFormat)
{
$XmlWriter.WriteAttributeString('type', 'Powershell')
$XmlWriter.WriteAttributeString('type', 'PowerShell')

# TODO: This used to be writing $PesterState.Path, back when that was a single string (and existed.)
# Better would be to produce a test suite for each resolved file, rather than for the value
Expand Down
2 changes: 1 addition & 1 deletion Functions/TestsRunningInCleanRunspace.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
} -ArgumentList $PesterPath, $TestDrive, $ScriptBlock, $GenerateNUnitReport
$job | Wait-Job | Out-Null

#not using Recieve-Job to ignore any output to Host
#not using Receive-Job to ignore any output to Host
#TODO: how should this handle errors?
#$job.Error | foreach { throw $_.Exception }
$job.Output
Expand Down
4 changes: 2 additions & 2 deletions Pester.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
<id>Pester</id>
<version>$version$</version>
<title>Pester</title>
<summary>A BDD style testing tool for Powershell</summary>
<description>Pester provides a framework for running BDD style Tests to execute and validate PowerShell commands inside of PowerShell and offers a powerful set of Mocking Functions that allow tests to mimic and mock the functionality of any command inside of a piece of powershell code being tested. Pester tests can execute any command or script that is accesible to a pester test file. This can include functions, Cmdlets, Modules and scripts. Pester can be run in ad hoc style in a console or it can be integrated into the Build scripts of a Continuous Integration system.</description>
<summary>A BDD style testing tool for PowerShell</summary>
<description>Pester provides a framework for running BDD style Tests to execute and validate PowerShell commands inside of PowerShell and offers a powerful set of Mocking Functions that allow tests to mimic and mock the functionality of any command inside of a piece of PowerShell code being tested. Pester tests can execute any command or script that is accessible to a pester test file. This can include functions, Cmdlets, Modules and scripts. Pester can be run in ad hoc style in a console or it can be integrated into the Build scripts of a Continuous Integration system.</description>
<tags>powershell unit testing bdd tdd mocking admin</tags>
<authors>Pester Team</authors>
<iconUrl>http://pesterbdd.com/images/Pester.png</iconUrl>
Expand Down
2 changes: 1 addition & 1 deletion Pester.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ CompanyName = 'Pester'
Copyright = 'Copyright (c) 2016 by Pester Team, licensed under Apache 2.0 License.'

# Description of the functionality provided by this module
Description = 'Pester provides a framework for running BDD style Tests to execute and validate PowerShell commands inside of PowerShell and offers a powerful set of Mocking Functions that allow tests to mimic and mock the functionality of any command inside of a piece of powershell code being tested. Pester tests can execute any command or script that is accesible to a pester test file. This can include functions, Cmdlets, Modules and scripts. Pester can be run in ad hoc style in a console or it can be integrated into the Build scripts of a Continuous Integration system.'
Description = 'Pester provides a framework for running BDD style Tests to execute and validate PowerShell commands inside of PowerShell and offers a powerful set of Mocking Functions that allow tests to mimic and mock the functionality of any command inside of a piece of PowerShell code being tested. Pester tests can execute any command or script that is accessible to a pester test file. This can include functions, Cmdlets, Modules and scripts. Pester can be run in ad hoc style in a console or it can be integrated into the Build scripts of a Continuous Integration system.'

# Minimum version of the Windows PowerShell engine required by this module
PowerShellVersion = '2.0'
Expand Down
2 changes: 1 addition & 1 deletion Pester.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ To run Pester tests in scripts that take parameter values, use the Script
parameter with a hash table value.
Also, by default, Pester tests write test results to the console host, much like
Write-Host does, but you can use the Quiet parameter to supress the host
Write-Host does, but you can use the Quiet parameter to suppress the host
messages, use the PassThru parameter to generate a custom object
(PSCustomObject) that contains the test results, use the OutputXml and
OutputFormat parameters to write the test results to an XML file, and use the
Expand Down

0 comments on commit 6680807

Please sign in to comment.