-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
110 additions
and
86 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,48 @@ | ||
#requires -Module F7History | ||
|
||
# Describe "f7_history" { | ||
# Context "The f7_history function" { | ||
# $cmd = $null | ||
# try { | ||
# $cmd = get-item -path Function:\f7_history | ||
# } catch { | ||
# $cmd = $null | ||
# } | ||
|
||
# It " is defined" { | ||
# $cmd | Should -Be "f7_history" | ||
# } | ||
# } | ||
Describe "f7_history" { | ||
Context "The f7_history function" { | ||
BeforeAll { | ||
$cmd = $null | ||
try { | ||
$cmd = get-item -path Function:\f7_history | ||
} | ||
catch { | ||
$cmd = $null | ||
} | ||
} | ||
It " is defined" { | ||
$cmd | Should -Be "f7_history" | ||
} | ||
} | ||
|
||
# Context "The f7_history function" { | ||
# $parameters = (Get-Command f7_history).Parameters | ||
# It "has a required string parameter for the global flag" { | ||
# $parameters.ContainsKey("global") | Should -Be $true | ||
# $parameters["global"].ParameterType | Should -Be ([boolean]) | ||
# $parameters["global"].Attributes.Where{$_ -is [Parameter]}.Mandatory | Should -Be $true | ||
# } | ||
# } | ||
Context "The f7_history function" { | ||
BeforeAll { | ||
$parameters = (Get-Command f7_history).Parameters | ||
} | ||
It "has a required string parameter for the global flag" { | ||
$parameters.ContainsKey("global") | Should -Be $true | ||
$parameters["global"].ParameterType | Should -Be ([boolean]) | ||
$parameters["global"].Attributes.Where{ $_ -is [Parameter] }.Mandatory | Should -Be $true | ||
} | ||
} | ||
|
||
# Context "Default key bindings" { | ||
# $Result = (Get-PSReadLineKeyHandler -Chord F7).Function | ||
# It "defines F7 as the default key binding" { | ||
# $Result | Should -Be "Show Matching Command History" | ||
# } | ||
Context "Default F7 keybinding " { | ||
BeforeAll { | ||
$Result = (Get-PSReadLineKeyHandler -Chord F7).Function | ||
} | ||
It "defines F7 as the default key binding" { | ||
$Result | Should -Be "Show Matching Command History" | ||
} | ||
|
||
# $Result = (Get-PSReadLineKeyHandler -Chord Shift-F7).Function | ||
# It "defines Shift-F7 as the default key binding" { | ||
# $Result | Should -Be "Show Matching Command History for All" | ||
# } | ||
# } | ||
# } | ||
} | ||
|
||
Context "Default Shift-F7 keybinding " { | ||
BeforeAll { | ||
$Result = (Get-PSReadLineKeyHandler -Chord Shift-F7).Function | ||
} | ||
It "defines Shift-F7 as the default key binding" { | ||
$Result | Should -Be "Show Matching Command History for All" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters