Skip to content

Commit

Permalink
🐛 AboutAssertions - Avoid Casting [Blank] to [bool] (#316)
Browse files Browse the repository at this point in the history
* 🐛 Avoid casting [Blank] to [bool]
This cast always returns $true, so don't pass [Blank] to Should -BeTrue

* 📝 Update intro text a little.
  • Loading branch information
vexx32 committed Oct 29, 2019
1 parent 8e37746 commit 99ece96
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions PSKoans/Koans/Introduction/AboutAssertions.Koans.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ param()
This is where the fun begins! Each koan contains an example designed
to teach you a lesson about PowerShell. If you execute the program
defined in this project, you will get a message that the koan below
has failed. Your job is to fill in the blanks (the __, $__, FILL_ME_IN,
or $FILL_ME_IN symbols) to make it pass. Once you make the change,
re-run the program to make sure the koan passes, and continue on to the
next failing koan. With each passing koan, you'll learn more about
PowerShell, and add another weapon to your PowerShell scripting arsenal.
has failed. Your job is to fill in the blanks (the __ or ____ symbols)
to make it pass. Once you make the change, call Show-Karma to make sure
the koan passes, and continue on to the next failing koan.
With each passing koan, you'll learn more about PowerShell, and add
another tool to your PowerShell scripting belt.
#>
Describe 'Equality' {

Expand All @@ -30,7 +30,7 @@ Describe 'Equality' {
It 'expects you to fill in values' {
# Initiative will be rewarded.
__ | Should -Be (1 + 2)
__ + 5 -eq 10 | Should -BeTrue
__ + 5 | Should -Be 10
}

It 'sets the expectations' {
Expand All @@ -45,6 +45,6 @@ Describe 'Equality' {

It 'demands balance' {
# Both sides of the scale must be of equal measure.
__ + 2 -eq 3 | Should -BeTrue
__ + 2 | Should -Be 3
}
}

0 comments on commit 99ece96

Please sign in to comment.