Guest User

Untitled

a guest
Jul 22nd, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.00 KB | None | 0 0
  1. <#
  2. Install-Module -Name Pester -Force -SkipPublisherCheck
  3.  
  4. #>
  5.  
  6. $here = Split-Path -Parent $MyInvocation.MyCommand.Path
  7. $sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path) -replace '\.Tests\.', '.'
  8. . "$here\$sut"
  9.  
  10. Describe "Check-Files" {
  11. Context "Without Cache" {
  12.  
  13. }
  14. Context "With Cache" {
  15. $cache = @{
  16. "file1.txt" = [PSCustomObject]@{
  17. LastWriteTime = "2018/01/01 00:00:00"
  18. CreationTime = "2018/01/01 00:00:00"
  19. LastAccessTime = "2018/01/01 00:00:00"
  20. Length = 10
  21. }
  22. }
  23. ConvertTo-Json $cache | OUt-File "cache_test.json"
  24. It "can detect difference" {
  25. $result = Check-Files -cache_file "cache_test.json"
  26. $result | Should BeLikeExactly '*LastWriteTime*'
  27. }
  28. }
  29.  
  30. Context "DecodeBody" {
  31. It "can decode" -TestCases @(
  32. @{ CSet = 'UTF-8'; Enc = 'quoted-printable'; Raw = '=E6=97=A5=E6=9C=AC'; Expected = '日本' }
  33. ) {
  34. param ($CSet, $Enc, $Raw, $Expected)
  35.  
  36. #DecodeBody $Raw $CSet $Enc | Should Be $Expected
  37. }
  38. }
  39. }
Add Comment
Please, Sign In to add comment