Skip to content

Commit

Permalink
Save all files with UTF8BOM (pester#1950)
Browse files Browse the repository at this point in the history
  • Loading branch information
nohwnd authored May 17, 2021
1 parent 52067e0 commit 24c865b
Show file tree
Hide file tree
Showing 135 changed files with 138 additions and 135 deletions.
5 changes: 4 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,8 @@
"editor.formatOnSave": true,
"powershell.codeFormatting.addWhitespaceAroundPipe": true,
"powershell.codeFormatting.pipelineIndentationStyle": "IncreaseIndentationForFirstPipeline",
"yaml.format.singleQuote": true
"yaml.format.singleQuote": true,
"[powershell]": {
"files.encoding": "utf8bom"
}
}
2 changes: 1 addition & 1 deletion PSScriptAnalyzerSettings.psd1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@{
@{
Severity = @('Error', 'Warning')
IncludeDefaultRules = $true
CustomRulePath = './Pester.BuildAnalyzerRules'
Expand Down
2 changes: 1 addition & 1 deletion Pester.BuildAnalyzerRules/Pester.BuildAnalyzerRules.psd1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@{
@{

# Script module or binary module file associated with this manifest.
RootModule = 'Pester.BuildAnalyzerRules.psm1'
Expand Down
2 changes: 1 addition & 1 deletion Pester.BuildAnalyzerRules/Pester.BuildAnalyzerRules.psm1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Get list of SafeCommands
# Get list of SafeCommands
$SafeCommands = & { . "$PSScriptRoot/../src/functions/Pester.SafeCommands.ps1"; $Script:SafeCommands }
# Workaround as RuleSuppressionID-based suppression is bugged. returns error.
# Should be replaced with the following line when PSScriptAnalyzer is fixed. See Invoke-Pester
Expand Down
2 changes: 1 addition & 1 deletion build.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#! /usr/bin/pwsh
#! /usr/bin/pwsh

<#
.SYNOPSIS
Expand Down
2 changes: 1 addition & 1 deletion docs/Examples/Planets/Get-Planet.Tests.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# In practice tests and your code are placed in two
# In practice tests and your code are placed in two
# separate files. Tests belong in .Tests.ps1 file and code belongs
# in .ps1 file. Open the Get-Planet.ps1 file as well, please.

Expand Down
2 changes: 1 addition & 1 deletion docs/Examples/Planets/Get-Planet.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# This is not the best file to start from,
# This is not the best file to start from,
# open Get-Planet.Tests.ps1 as well :)

function Get-Planet ([string]$Name = '*') {
Expand Down
2 changes: 1 addition & 1 deletion publish/buildNugetPackage.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
$VerbosePreference = 'Continue'
$VerbosePreference = 'Continue'
$ErrorActionPreference = 'Stop'

try {
Expand Down
2 changes: 1 addition & 1 deletion publish/chocolateyInstall.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[CmdletBinding()]
[CmdletBinding()]
param ( )

end {
Expand Down
2 changes: 1 addition & 1 deletion publish/cleanUpBeforeBuild.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# cleaning up remains of previous builds
# cleaning up remains of previous builds
# examples and all test files
# in the next step we sign all scripts so
# we want to reduce how many files will be signed
Expand Down
2 changes: 1 addition & 1 deletion publish/getNugetExe.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
$VerbosePreference = 'Continue'
$VerbosePreference = 'Continue'
$ErrorActionPreference = 'Stop'

try {
Expand Down
2 changes: 1 addition & 1 deletion publish/publishPSGalleryPackage.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
param (
param (
[Parameter(Mandatory)]
[string] $ApiKey,
[Parameter(Mandatory)]
Expand Down
2 changes: 1 addition & 1 deletion publish/release.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# build should provide '%system.teamcity.build.checkoutDir%'
# build should provide '%system.teamcity.build.checkoutDir%'
param (
[Parameter(Mandatory)]
[String] $PsGalleryApiKey,
Expand Down
2 changes: 1 addition & 1 deletion publish/signModule.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
param($Thumbprint, $Path)
param($Thumbprint, $Path)
$ErrorActionPreference = 'Stop'

$cert = Get-ChildItem Cert:\CurrentUser\My |
Expand Down
2 changes: 1 addition & 1 deletion publish/testRelease.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
param(
param(
[switch] $LocalBuild
)

Expand Down
2 changes: 1 addition & 1 deletion src/Format.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# PESTER_BUILD
# PESTER_BUILD
if (-not (Get-Variable -Name "PESTER_BUILD" -ValueOnly -ErrorAction Ignore)) {
. "$PSScriptRoot/functions/Pester.SafeCommands.ps1"
. "$PSScriptRoot/TypeClass.ps1"
Expand Down
2 changes: 1 addition & 1 deletion src/Main.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
function Assert-ValidAssertionName {
function Assert-ValidAssertionName {
param([string]$Name)
if ($Name -notmatch '^\S+$') {
throw "Assertion name '$name' is invalid, assertion name must be a single word."
Expand Down
2 changes: 1 addition & 1 deletion src/Pester.RSpec.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
function Find-File {
function Find-File {
[CmdletBinding()]
param (
[Parameter(Mandatory = $true)]
Expand Down
2 changes: 1 addition & 1 deletion src/Pester.Runtime.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# PESTER_BUILD
# PESTER_BUILD
if (-not (Get-Variable -Name "PESTER_BUILD" -ValueOnly -ErrorAction Ignore)) {
. "$PSScriptRoot/Pester.Utility.ps1"
. "$PSScriptRoot/functions/Pester.SafeCommands.ps1"
Expand Down
2 changes: 1 addition & 1 deletion src/Pester.State.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
$script:AssertionOperators = [Collections.Generic.Dictionary[string, object]]([StringComparer]::InvariantCultureIgnoreCase)
$script:AssertionOperators = [Collections.Generic.Dictionary[string, object]]([StringComparer]::InvariantCultureIgnoreCase)
$script:AssertionAliases = [Collections.Generic.Dictionary[string, object]]([StringComparer]::InvariantCultureIgnoreCase)
$script:AssertionDynamicParams = [Pester.Factory]::CreateRuntimeDefinedParameterDictionary()
$script:DisableScopeHints = $true
2 changes: 1 addition & 1 deletion src/Pester.Types.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# e.g. $minimumVersionRequired = "5.1.0.0" -as [version]
# e.g. $minimumVersionRequired = "5.1.0.0" -as [version]
$minimumVersionRequired = $ExecutionContext.SessionState.Module.PrivateData.RequiredAssemblyVersion -as [version]

# Check if the type exists, which means we have a conflict because the assembly is already loaded
Expand Down
2 changes: 1 addition & 1 deletion src/Pester.Utility.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
function or {
function or {
[CmdletBinding()]
param (
[Parameter(Mandatory = $true, Position = 0)]
Expand Down
2 changes: 1 addition & 1 deletion src/Pester.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
param ($ScriptBlock)
param ($ScriptBlock)

. $ScriptBlock

2 changes: 1 addition & 1 deletion src/Pester.psd1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@{
@{

# Script module or binary module file associated with this manifest.
RootModule = 'Pester.psm1'
Expand Down
2 changes: 1 addition & 1 deletion src/TypeClass.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
function Is-Value ($Value) {
function Is-Value ($Value) {
$Value = $($Value)
$Value -is [ValueType] -or $Value -is [string] -or $value -is [scriptblock]
}
Expand Down
2 changes: 1 addition & 1 deletion src/functions/Context.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
function Context {
function Context {
<#
.SYNOPSIS
Provides logical grouping of It blocks within a single Describe block.
Expand Down
2 changes: 1 addition & 1 deletion src/functions/Coverage.Plugin.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
function Get-CoveragePlugin {
function Get-CoveragePlugin {
New-PluginObject -Name "Coverage" -RunStart {
param($Context)

Expand Down
2 changes: 1 addition & 1 deletion src/functions/Coverage.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
function Enter-CoverageAnalysis {
function Enter-CoverageAnalysis {
[CmdletBinding()]
param (
[object[]] $CodeCoverage,
Expand Down
2 changes: 1 addition & 1 deletion src/functions/Describe.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
function Describe {
function Describe {
<#
.SYNOPSIS
Creates a logical group of tests.
Expand Down
2 changes: 1 addition & 1 deletion src/functions/Environment.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
function GetPesterPsVersion {
function GetPesterPsVersion {
# accessing the value indirectly so it can be mocked
(& $SafeCommands['Get-Variable'] 'PSVersionTable' -ValueOnly).PSVersion.Major
}
Expand Down
2 changes: 1 addition & 1 deletion src/functions/Get-ShouldOperator.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
function Get-ShouldOperator {
function Get-ShouldOperator {
<#
.SYNOPSIS
Display the assertion operators available for use with Should.
Expand Down
2 changes: 1 addition & 1 deletion src/functions/In.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
function In {
function In {
<#
.SYNOPSIS
A convenience function that executes a script from a specified path.
Expand Down
2 changes: 1 addition & 1 deletion src/functions/InModuleScope.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
function InModuleScope {
function InModuleScope {
<#
.SYNOPSIS
Allows you to execute parts of a test script within the
Expand Down
2 changes: 1 addition & 1 deletion src/functions/It.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
function It {
function It {
<#
.SYNOPSIS
Validates the results of a test inside of a Describe block.
Expand Down
2 changes: 1 addition & 1 deletion src/functions/New-Fixture.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
function New-Fixture {
function New-Fixture {
<#
.SYNOPSIS
This function generates two scripts, one that defines a function
Expand Down
2 changes: 1 addition & 1 deletion src/functions/New-MockObject.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
function New-MockObject {
function New-MockObject {
<#
.SYNOPSIS
This function instantiates a .NET object from a type.
Expand Down
2 changes: 1 addition & 1 deletion src/functions/Output.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
$script:ReportStrings = DATA {
$script:ReportStrings = DATA {
@{
StartMessage = "Executing all tests in '{0}'"
FilterMessage = ' matching test name {0}'
Expand Down
2 changes: 1 addition & 1 deletion src/functions/Pester.Debugging.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
function Count-Scopes {
function Count-Scopes {
param(
[Parameter(Mandatory = $true)]
$ScriptBlock)
Expand Down
2 changes: 1 addition & 1 deletion src/functions/Pester.SafeCommands.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Tried using $ExecutionState.InvokeCommand.GetCmdlet() here, but it does not trigger module auto-loading the way
# Tried using $ExecutionState.InvokeCommand.GetCmdlet() here, but it does not trigger module auto-loading the way
# Get-Command does. Since this is at import time, before any mocks have been defined, that's probably acceptable.
# If someone monkeys with Get-Command before they import Pester, they may break something.

Expand Down
2 changes: 1 addition & 1 deletion src/functions/Pester.Scoping.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
function Set-ScriptBlockScope {
function Set-ScriptBlockScope {
[CmdletBinding()]
param (
[Parameter(Mandatory = $true)]
Expand Down
2 changes: 1 addition & 1 deletion src/functions/Pester.SessionState.Mock.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# session state bound functions that act as endpoints,
# session state bound functions that act as endpoints,
# so the internal funtions can make their session state
# consumption explicit and are testable (also prevents scrolling past
# the whole documentation :D )
Expand Down
2 changes: 1 addition & 1 deletion src/functions/Set-ItResult.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
function Set-ItResult {
function Set-ItResult {
<#
.SYNOPSIS
Set-ItResult is used inside the It block to explicitly set the test result
Expand Down
2 changes: 1 addition & 1 deletion src/functions/SetupTeardown.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
function BeforeEach {
function BeforeEach {
<#
.SYNOPSIS
Defines a series of steps to perform at the beginning of every It block within
Expand Down
2 changes: 1 addition & 1 deletion src/functions/TestDrive.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
function Get-TestDrivePlugin {
function Get-TestDrivePlugin {

# TODO: add OnStart block and put this in it

Expand Down
2 changes: 1 addition & 1 deletion src/functions/TestRegistry.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
function New-TestRegistry {
function New-TestRegistry {
param(
[Switch]
$PassThru,
Expand Down
2 changes: 1 addition & 1 deletion src/functions/TestResults.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
function Get-HumanTime {
function Get-HumanTime {
param( [TimeSpan] $TimeSpan)
if ($TimeSpan.Ticks -lt [timespan]::TicksPerSecond) {
$time = [int]($TimeSpan.TotalMilliseconds)
Expand Down
2 changes: 1 addition & 1 deletion src/functions/assertions/Be.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#Be
#Be
function Should-Be ($ActualValue, $ExpectedValue, [switch] $Negate, [string] $Because) {
<#
.SYNOPSIS
Expand Down
2 changes: 1 addition & 1 deletion src/functions/assertions/BeGreaterThan.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
function Should-BeGreaterThan($ActualValue, $ExpectedValue, [switch] $Negate, [string] $Because) {
function Should-BeGreaterThan($ActualValue, $ExpectedValue, [switch] $Negate, [string] $Because) {
<#
.SYNOPSIS
Asserts that a number (or other comparable value) is greater than an expected value.
Expand Down
2 changes: 1 addition & 1 deletion src/functions/assertions/BeIn.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
function Should-BeIn($ActualValue, $ExpectedValue, [switch] $Negate, [string] $Because) {
function Should-BeIn($ActualValue, $ExpectedValue, [switch] $Negate, [string] $Because) {
<#
.SYNOPSIS
Asserts that a collection of values contain a specific value.
Expand Down
2 changes: 1 addition & 1 deletion src/functions/assertions/BeLessThan.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
function Should-BeLessThan($ActualValue, $ExpectedValue, [switch] $Negate, [string] $Because) {
function Should-BeLessThan($ActualValue, $ExpectedValue, [switch] $Negate, [string] $Because) {
<#
.SYNOPSIS
Asserts that a number (or other comparable value) is lower than an expected value.
Expand Down
2 changes: 1 addition & 1 deletion src/functions/assertions/BeLike.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
function Should-BeLike($ActualValue, $ExpectedValue, [switch] $Negate, [String] $Because) {
function Should-BeLike($ActualValue, $ExpectedValue, [switch] $Negate, [String] $Because) {
<#
.SYNOPSIS
Asserts that the actual value matches a wildcard pattern using PowerShell's -like operator.
Expand Down
2 changes: 1 addition & 1 deletion src/functions/assertions/BeLikeExactly.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
function Should-BeLikeExactly($ActualValue, $ExpectedValue, [switch] $Negate, [String] $Because) {
function Should-BeLikeExactly($ActualValue, $ExpectedValue, [switch] $Negate, [String] $Because) {
<#
.SYNOPSIS
Asserts that the actual value matches a wildcard pattern using PowerShell's -like operator.
Expand Down
2 changes: 1 addition & 1 deletion src/functions/assertions/BeNullOrEmpty.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@


function Should-BeNullOrEmpty([object[]] $ActualValue, [switch] $Negate, [string] $Because) {
<#
.SYNOPSIS
Expand Down
2 changes: 1 addition & 1 deletion src/functions/assertions/BeOfType.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@


function Should-BeOfType($ActualValue, $ExpectedType, [switch] $Negate, [string]$Because) {
<#
.SYNOPSIS
Expand Down
2 changes: 1 addition & 1 deletion src/functions/assertions/BeTrueOrFalse.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
function Should-BeTrue($ActualValue, [switch] $Negate, [string] $Because) {
function Should-BeTrue($ActualValue, [switch] $Negate, [string] $Because) {
<#
.SYNOPSIS
Asserts that the value is true, or truthy.
Expand Down
2 changes: 1 addition & 1 deletion src/functions/assertions/Contain.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
function Should-Contain($ActualValue, $ExpectedValue, [switch] $Negate, [string] $Because) {
function Should-Contain($ActualValue, $ExpectedValue, [switch] $Negate, [string] $Because) {
<#
.SYNOPSIS
Asserts that collection contains a specific value.
Expand Down
2 changes: 1 addition & 1 deletion src/functions/assertions/Exist.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
function Should-Exist($ActualValue, [switch] $Negate, [string] $Because) {
function Should-Exist($ActualValue, [switch] $Negate, [string] $Because) {
<#
.SYNOPSIS
Does not perform any comparison, but checks if the object calling Exist is present in a PS Provider.
Expand Down
2 changes: 1 addition & 1 deletion src/functions/assertions/FileContentMatch.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
function Should-FileContentMatch($ActualValue, $ExpectedContent, [switch] $Negate, $Because) {
function Should-FileContentMatch($ActualValue, $ExpectedContent, [switch] $Negate, $Because) {
<#
.SYNOPSIS
Checks to see if a file contains the specified text.
Expand Down
2 changes: 1 addition & 1 deletion src/functions/assertions/FileContentMatchExactly.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
function Should-FileContentMatchExactly($ActualValue, $ExpectedContent, [switch] $Negate, [String] $Because) {
function Should-FileContentMatchExactly($ActualValue, $ExpectedContent, [switch] $Negate, [String] $Because) {
<#
.SYNOPSIS
Checks to see if a file contains the specified text.
Expand Down
2 changes: 1 addition & 1 deletion src/functions/assertions/FileContentMatchMultiline.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
function Should-FileContentMatchMultiline($ActualValue, $ExpectedContent, [switch] $Negate, [String] $Because) {
function Should-FileContentMatchMultiline($ActualValue, $ExpectedContent, [switch] $Negate, [String] $Because) {
<#
.SYNOPSIS
As opposed to FileContentMatch and FileContentMatchExactly operators,
Expand Down
2 changes: 1 addition & 1 deletion src/functions/assertions/HaveCount.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
function Should-HaveCount($ActualValue, [int] $ExpectedValue, [switch] $Negate, [string] $Because) {
function Should-HaveCount($ActualValue, [int] $ExpectedValue, [switch] $Negate, [string] $Because) {
<#
.SYNOPSIS
Asserts that a collection has the expected amount of items.
Expand Down
2 changes: 1 addition & 1 deletion src/functions/assertions/HaveParameter.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
function Should-HaveParameter (
function Should-HaveParameter (
$ActualValue,
[String] $ParameterName,
$Type,
Expand Down
2 changes: 1 addition & 1 deletion src/functions/assertions/Match.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
function Should-Match($ActualValue, $RegularExpression, [switch] $Negate, [string] $Because) {
function Should-Match($ActualValue, $RegularExpression, [switch] $Negate, [string] $Because) {
<#
.SYNOPSIS
Uses a regular expression to compare two objects.
Expand Down
2 changes: 1 addition & 1 deletion src/functions/assertions/MatchExactly.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
function Should-MatchExactly($ActualValue, $RegularExpression, [switch] $Negate, [string] $Because) {
function Should-MatchExactly($ActualValue, $RegularExpression, [switch] $Negate, [string] $Because) {
<#
.SYNOPSIS
Uses a regular expression to compare two objects.
Expand Down
2 changes: 1 addition & 1 deletion src/functions/assertions/PesterThrow.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
function Should-Throw {
function Should-Throw {
param (
[ScriptBlock] $ActualValue,
[string] $ExpectedMessage,
Expand Down
2 changes: 1 addition & 1 deletion test.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#! /usr/bin/pwsh
#! /usr/bin/pwsh

<#
.SYNOPSIS
Expand Down
Loading

0 comments on commit 24c865b

Please sign in to comment.