Skip to content

Commit

Permalink
Fixes auto-succeeding pester tests in AboutComparison and AboutStrings (
Browse files Browse the repository at this point in the history
#214)

* Fixed "adds strings together" 

It "adds strings together" was passing the pester test without user input. Replaced the contents of $String1 with '__' so the user can solve it.

* Fixed It's that are autopassing the pester tests

Auto-passing tests:
It 'is a simple test'
It 'returns $true if either input is $true'
It 'negates a boolean value'
In all three instances, __ evaluates to $true, which causes the tests to pass. 

I replaced __ with $__ in these instances to make sure the tests fail.

* Updated $__ to $____ 

Added two extra underscores to each $__ to make sure no one will confuse $__ for $_

* Update PSKoans/Koans/Foundations/AboutStrings.Koans.ps1

Longer blanks! Better blanks!

Co-Authored-By: Joel Sallow (/u/ta11ow) <32407840+vexx32@users.noreply.github.com>
  • Loading branch information
EVWorth and vexx32 committed Jul 2, 2019
1 parent c8c4893 commit 09f013c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions PSKoans/Koans/Foundations/AboutComparison.Koans.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Describe 'Comparison Operators' {

It 'is a simple test' {
$true -eq $false | Should -Be $false
__ | Should -Be (1 -eq 1)
$____ | Should -Be (1 -eq 1)
}

It 'will attempt to convert types' {
Expand Down Expand Up @@ -168,8 +168,8 @@ Describe 'Logical Operators' {

It 'returns $true if either input is $true' {
$true -or $false | Should -Be $true
__ | Should -Be ($false -or $true)
__ | Should -Be ($true -or $true)
$____ | Should -Be ($false -or $true)
$____ | Should -Be ($true -or $true)
}

It 'may coerce values to boolean' {
Expand All @@ -193,7 +193,7 @@ Describe 'Logical Operators' {

It 'negates a boolean value' {
-not $true | Should -Be $false
__ | Should -Be (-not $false)
$____ | Should -Be (-not $false)
}

It 'can be shortened to !' {
Expand Down
2 changes: 1 addition & 1 deletion PSKoans/Koans/Foundations/AboutStrings.Koans.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ Describe 'Strings' {

It 'adds strings together' {
# Two become one.
$String1 = 'This string'
$String1 = '_____'
$String2 = 'is cool.'

$String1 + ' ' + $String2 | Should -Be 'This string is cool.'
Expand Down

0 comments on commit 09f013c

Please sign in to comment.