Reformat Measure-Object test (#4972)
Remove multiple tabs and formatting issues.
This commit is contained in:
parent
f69b760f2b
commit
6a68262ba2
|
@ -1,5 +1,7 @@
|
|||
Describe "Measure-Object" -Tags "CI" {
|
||||
BeforeAll {
|
||||
$testObject = 1,3,4
|
||||
}
|
||||
|
||||
It "Should be able to be called without error" {
|
||||
{ Measure-Object | Out-Null } | Should Not Throw
|
||||
|
@ -71,7 +73,6 @@ Describe "Measure-Object" -Tags "CI" {
|
|||
{
|
||||
if ( $testObject[$i] -lt $expected )
|
||||
{
|
||||
|
||||
$expected = $testObject[$i]
|
||||
}
|
||||
}
|
||||
|
@ -88,7 +89,6 @@ Describe "Measure-Object" -Tags "CI" {
|
|||
{
|
||||
if ( $testMinimum[$i] -lt $expected )
|
||||
{
|
||||
|
||||
$expected = $testMinimum[$i]
|
||||
}
|
||||
}
|
||||
|
@ -104,7 +104,6 @@ Describe "Measure-Object" -Tags "CI" {
|
|||
{
|
||||
if ( $testObject[$i] -gt $expected )
|
||||
{
|
||||
|
||||
$expected = $testObject[$i]
|
||||
}
|
||||
}
|
||||
|
@ -121,7 +120,6 @@ Describe "Measure-Object" -Tags "CI" {
|
|||
{
|
||||
if ( $testMaximum[$i] -gt $expected )
|
||||
{
|
||||
|
||||
$expected = $testMaximum[$i]
|
||||
}
|
||||
}
|
||||
|
@ -131,9 +129,10 @@ Describe "Measure-Object" -Tags "CI" {
|
|||
}
|
||||
|
||||
Context "String tests" {
|
||||
BeforeAll {
|
||||
$nl = [Environment]::NewLine
|
||||
|
||||
$testString = "HAD I the heavens' embroidered cloths,$nl Enwrought with golden and silver light,$nl The blue and the dim and the dark cloths$nl Of night and light and the half light,$nl I would spread the cloths under your feet:$nl But I, being poor, have only my dreams;$nl I have spread my dreams under your feet;$nl Tread softly because you tread on my dreams."
|
||||
}
|
||||
|
||||
It "Should be able to count the number of words in a string" {
|
||||
$expectedLength = $testString.Replace($nl,"").Split().length
|
||||
|
@ -159,7 +158,6 @@ Describe "Measure-Object" -Tags "CI" {
|
|||
}
|
||||
|
||||
Describe "Measure-Object DRT basic functionality" -Tags "CI" {
|
||||
|
||||
BeforeAll {
|
||||
if(-not ([System.Management.Automation.PSTypeName]'TestMeasureGeneric').Type)
|
||||
{
|
||||
|
@ -174,6 +172,7 @@ Describe "Measure-Object DRT basic functionality" -Tags "CI" {
|
|||
}
|
||||
"@
|
||||
}
|
||||
|
||||
if(-not ([System.Management.Automation.PSTypeName]'TestMeasureText').Type)
|
||||
{
|
||||
Add-Type -TypeDefinition @"
|
||||
|
@ -187,6 +186,7 @@ Describe "Measure-Object DRT basic functionality" -Tags "CI" {
|
|||
}
|
||||
"@
|
||||
}
|
||||
|
||||
$employees = [pscustomobject]@{"FirstName"="joseph"; "LastName"="smith"; "YearsInMS"=15},
|
||||
[pscustomobject]@{"FirstName"="paul"; "LastName"="smith"; "YearsInMS"=15},
|
||||
[pscustomobject]@{"FirstName"="mary jo"; "LastName"="soe"; "YearsInMS"=5},
|
||||
|
@ -302,7 +302,7 @@ Describe "Measure-Object DRT basic functionality" -Tags "CI" {
|
|||
}
|
||||
|
||||
It "Measure-Object with multiple lines should work"{
|
||||
$result = "123`n4"|measure-object -line
|
||||
$result = "123`n4" | Measure-Object -Line
|
||||
$result.Lines | Should Be 2
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue