Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Seemingly correct answer in AboutStrings invalidates the rest of the script #405

Closed
how-do-i-computer opened this issue Jul 18, 2020 · 1 comment
Labels
Category-Koans Invoking the Great Doubt Issue-Discussion Let's talk about it!

Comments

@how-do-i-computer
Copy link

Describe "Koan Bug, Issue, or Help Request"

AboutStringsKoans.ps1

Context "The Problematic Assertions"

It 'will expand variables that do not exist' {
<#
If a string contains a variable that has not been created,
PowerShell will still try to expand the value. A variable that
doesn't exist or has a null value will simply disappear when it
is expanded.

            This could be the result of a typing mistake.
        #>
        $String = "PowerShell's home folder is: $SPHome"
        '____' | Should -Be $String
    }

Context "Your Attempts"

'PowerShell's home folder is:'

Context "Additional Information"

The ' in "PowerShell's" results in the rest of the script being invalidated. I can't figure out what answer will solve this part of the koan. I tried adding escape characters but it didn't work (I might not be doing it right).

@how-do-i-computer how-do-i-computer added Category-Koans Invoking the Great Doubt Issue-Discussion Let's talk about it! labels Jul 18, 2020
@how-do-i-computer how-do-i-computer changed the title Seemingly correct answer in AboutStrings.Koans.ps1 invalidates the rest of the script Seemingly correct answer in AboutStrings invalidates the rest of the script Jul 18, 2020
@vexx32
Copy link
Owner

vexx32 commented Jul 18, 2020

Oh, you're absolutely right. The answer string needs to be given as "____" as well, so that the single quote doesn't break things.

For now, you can do that as well (start and end the answer string with ") or just escape the single quote with an additional one (like this: '... PowerShell''s ...') to prevent it terminating the string too early.

Sorry about that, we'll get that patched up! Thanks for reporting this! 😊 💖

@vexx32 vexx32 closed this as completed in d39dd3b Jul 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Category-Koans Invoking the Great Doubt Issue-Discussion Let's talk about it!
Projects
None yet
Development

No branches or pull requests

2 participants