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

Fix function help example test #33

Merged
merged 1 commit into from
Sep 11, 2020

Conversation

TsekNet
Copy link
Contributor

@TsekNet TsekNet commented Sep 9, 2020

Pull Request

Issue

Function help example tests fail initially, as $help.examples.example does not have the count member property.

Issue #, if available:

Description

Description of changes:

Leverage the same tests used when testing function synopsis and description to ensure that the function help example exists, which is effectively the same as saying there's at least one example.

Tests run:

$help = get-help Set-CustomPrompt -full

PS> $help.examples.example


-------------------------- EXAMPLE 1 --------------------------

PS C:\>Set-CustomPrompt -Symbol '26A1' -Force



Forces the prompt to change, using the 'High Voltage' Emoji (⚡) as the
ASCII character is placed before the cursor.

PS> $help.examples.example.count


PS> $help.examples.example | Get-Member 




   TypeName: MamlCommandHelpInfo#example

Name         MemberType   Definition
----         ----------   ----------
Equals       Method       bool Equals(System.Object obj)
GetHashCode  Method       int GetHashCode()
GetType      Method       type GetType()
ToString     Method       string ToString()
code         NoteProperty System.String code=Set-CustomPrompt -Symbol '26A1' -Force
introduction NoteProperty psobject[] introduction=System.Management.Automation.PSObject[]
remarks      NoteProperty psobject[] remarks=System.Management.Automation.PSObject[]
title        NoteProperty System.String title=-------------------------- EXAMPLE 1 --------------------------

License

By submitting this pull request, I confirm that my contribution is made under the terms of the MIT license.

@techthoughts2 techthoughts2 merged commit 34c84fc into techthoughts2:Enhancements Sep 11, 2020
This was referenced Sep 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants