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

Issue with AboutPSProviders #179

Closed
arefg opened this issue May 22, 2019 · 2 comments · Fixed by #235
Closed

Issue with AboutPSProviders #179

arefg opened this issue May 22, 2019 · 2 comments · Fixed by #235
Labels
Category-Koans Invoking the Great Doubt Issue-Bug 🐛 Something's wrong! Up For Grabs / Hacktoberfest 💻 If it's Up For Grabs, take it and run with it! If not, ask if it's in progress / you can take it.

Comments

@arefg
Copy link

arefg commented May 22, 2019

On the following lines there should be '__' instead of __.

37 __ | Should -Be $Aliases.Name[0]

38 __ | Should -Be $Aliases.Definition[0]

72 $CmdletName = __

95 __ | Should -Be $Alias:gci

102 __ | Should -Be $AliasTarget

241 __ | Should -Be $VariableData.Options

257 __ | Should -Be $Variables.Where{$_.Name -eq 'ConfirmPreference'}.Value

279 __ | Should -Be $Info.Options

288 __ | Should -Be $Get

I think you tried to show that the number of aliases will grow by one after creating a new alias, so assuming that we need to reassign $Aliases = Get-ChildItem 'Alias:' before line 55 to be able to see the new result, otherwise, this line will be the exact copy of line 49.

48 It 'can create aliases too!' {
49 __ | Should -Be $Aliases.Count
50
51 New-Item -Path 'Alias:\grok' -Value 'Get-Item' -ErrorAction SilentlyContinue
52 $File = grok '__' -ErrorAction SilentlyContinue
53
54 $File | Should -BeOfType 'System.IO.FileInfo'
55 __ | Should -Be $Aliases.Count
56
57 Remove-Item -Path 'Alias:\grok'
58 }

On this block, I had to change the index number so that I can pass the test because my $Functions[5] is 'AfterAll' function of the Pester module which has no verb or noun. This actually does not always result in the same names so it's hard to find an index that can be applied to everyone and every situation.

It 'allows access to all currently loaded functions' {
    # Most proper functions are named in the Verb-Noun convention
    '__' | Should -Be $Functions[5].Verb
    '__' | Should -Be $Functions[5].Noun
    '__' | Should -Be $Functions[5].Name

    '__' | Should -Be $Functions[4].Name
}

On these lines, I couldn't get them to work no matter what I put as the answer. It keeps telling "no exception was thrown.". I'm not sure if I'm missing something or there is something wrong with these lines.

251 {Get-Item 'Variable:\Test'} | Should -Throw -ExceptionType __

268 {Remove-Item 'Variable:\Test'} | Should -Throw -ExceptionType __

And finally, on line 267 __ | Should -Be $Var I couldn't find any other answer but $Var. This one is for my own information so it's not an issue. :)

@vexx32 vexx32 added Category-Koans Invoking the Great Doubt Issue-Bug 🐛 Something's wrong! Up For Grabs / Hacktoberfest 💻 If it's Up For Grabs, take it and run with it! If not, ask if it's in progress / you can take it. labels May 22, 2019
@vexx32
Copy link
Owner

vexx32 commented May 22, 2019

Nice finds, thank you! I'll have to go over this file at some point soon. :)

@vexx32 vexx32 added this to To do in Koan Topic Tracking via automation Jun 11, 2019
@6AAE10
Copy link
Contributor

6AAE10 commented Jul 23, 2019

I am also having issue in the next block:

It 'can be accessed with Get-Alias' {
$AliasObjects = Get-ChildItem 'Alias:'
$AliasObjects2 = Get-Alias

        173 | Should -Be $AliasObjects2.Count
        $AliasObjects | Should -Be $AliasObjects2
    }

this is what I get on my host:
PS C:> $AliasObjects2 = Get-Alias
PS C:> $AliasObjects2.Count
173

however, error message says "Expected 166, but got 173."

So I don't understand where the 166 come from?

vexx32 added a commit that referenced this issue Sep 3, 2019
Fix blank formats
Fix issues with Should -Throw assertions
Straighten out file
@vexx32 vexx32 mentioned this issue Sep 4, 2019
5 tasks
vexx32 added a commit that referenced this issue Sep 4, 2019
Fix blank formats
Fix issues with Should -Throw assertions
Straighten out file
Koan Topic Tracking automation moved this from To do to Done Sep 4, 2019
vexx32 added a commit that referenced this issue Sep 4, 2019
Fix blank formats
Fix issues with Should -Throw assertions
Straighten out file
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-Bug 🐛 Something's wrong! Up For Grabs / Hacktoberfest 💻 If it's Up For Grabs, take it and run with it! If not, ask if it's in progress / you can take it.
Projects
Development

Successfully merging a pull request may close this issue.

3 participants