From dba1d4468998d0592f6f4526cbd1546ebfbf98dc Mon Sep 17 00:00:00 2001 From: Peter Wawa Date: Tue, 8 Jun 2021 14:49:45 +0300 Subject: [PATCH 1/3] fix 'It will compare values' --- PSKoans/Koans/Foundations/AboutComparison.Koans.ps1 | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/PSKoans/Koans/Foundations/AboutComparison.Koans.ps1 b/PSKoans/Koans/Foundations/AboutComparison.Koans.ps1 index 1a2d1d1ae..3bf2ce63b 100644 --- a/PSKoans/Koans/Foundations/AboutComparison.Koans.ps1 +++ b/PSKoans/Koans/Foundations/AboutComparison.Koans.ps1 @@ -93,11 +93,13 @@ Describe 'Comparison Operators' { Context '-gt and -lt' { It 'will compare values' { + $Big = __ + $Small = __ 11 -gt 6 | Should -BeTrue - __ -gt 14 | Should -BeTrue + $Big -gt 14 | Should -BeTrue 10 -lt 20 | Should -BeTrue - __ -lt 0 | Should -BeTrue + $Small -lt 0 | Should -BeTrue } It 'will often return more than one item from arrays' { From 3bd8ddd9d549f9be1585c5f596da0525b7425f8e Mon Sep 17 00:00:00 2001 From: Peter Wawa Date: Tue, 8 Jun 2021 14:56:14 +0300 Subject: [PATCH 2/3] fix topic 'It returns $true only ...' - topic 'It returns $true only if both inputs are $true' --- PSKoans/Koans/Foundations/AboutComparison.Koans.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PSKoans/Koans/Foundations/AboutComparison.Koans.ps1 b/PSKoans/Koans/Foundations/AboutComparison.Koans.ps1 index 3bf2ce63b..c05f7a00f 100644 --- a/PSKoans/Koans/Foundations/AboutComparison.Koans.ps1 +++ b/PSKoans/Koans/Foundations/AboutComparison.Koans.ps1 @@ -192,7 +192,7 @@ Describe 'Logical Operators' { It 'returns $true only if both inputs are $true' { $true -and $true | Should -BeTrue - $____ -and $true | Should -BeFalse + $____ | Should -Be ($false -and $true) } It 'may coerce values to boolean' { From f1111aafbd7418b940e75be2879edf30fa3a967e Mon Sep 17 00:00:00 2001 From: Peter Wawa Date: Tue, 8 Jun 2021 14:57:45 +0300 Subject: [PATCH 3/3] fix topic 'It may coerce values to boolean' --- PSKoans/Koans/Foundations/AboutComparison.Koans.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PSKoans/Koans/Foundations/AboutComparison.Koans.ps1 b/PSKoans/Koans/Foundations/AboutComparison.Koans.ps1 index c05f7a00f..e76724a7c 100644 --- a/PSKoans/Koans/Foundations/AboutComparison.Koans.ps1 +++ b/PSKoans/Koans/Foundations/AboutComparison.Koans.ps1 @@ -214,9 +214,9 @@ Describe 'Logical Operators' { It 'may coerce values to boolean' { # Remember, empty strings convert to boolean as $false. $String = '' - $Number = __ + $Number = 1 - $String -or $Number | Should -BeTrue + $____ | Should -Be ($String -or $Number) } }