Files
PowerShell/test/powershell/Set-Alias.Tests.ps1
T

24 lines
759 B
PowerShell
Raw Normal View History

2015-10-30 16:05:51 -07:00
Describe "Set-Alias" {
Mock Get-Date { return "Friday, October 30, 2015 3:38:08 PM" }
It "Should be able to set alias without error" {
{ set-alias -Name gd -Value Get-Date } | Should Not Throw
}
It "Should be able to have the same output between set-alias and the output of the function being aliased" {
2015-10-30 16:12:40 -07:00
set-alias -Name gd -Value Get-Date
2015-10-30 16:05:51 -07:00
gd | Should Be $(Get-Date)
}
It "Should be able to use the sal alias" {
{ sal gd Get-Date } | Should Not Throw
}
It "Should have the same output between the sal alias and the original set-alias cmdlet" {
sal -Name gd -Value Get-Date
Set-Alias -Name gd2 -Value Get-Date
gd2 | Should Be $(gd)
}
2015-10-30 16:12:40 -07:00
}