From 60aab90d31325f061a13493af9ca7ceb8c03d2dd Mon Sep 17 00:00:00 2001 From: Zachary Folwick Date: Fri, 30 Oct 2015 16:05:51 -0700 Subject: [PATCH] added set-alias tests --- src/pester-tests/Set-Alias.Tests.ps1 | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 src/pester-tests/Set-Alias.Tests.ps1 diff --git a/src/pester-tests/Set-Alias.Tests.ps1 b/src/pester-tests/Set-Alias.Tests.ps1 new file mode 100644 index 000000000..56310d444 --- /dev/null +++ b/src/pester-tests/Set-Alias.Tests.ps1 @@ -0,0 +1,23 @@ +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" { + 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) + } +} \ No newline at end of file