Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <#
- Install-Module -Name Pester -Force -SkipPublisherCheck
- #>
- $here = Split-Path -Parent $MyInvocation.MyCommand.Path
- $sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path) -replace '\.Tests\.', '.'
- . "$here\$sut"
- Describe "Check-Files" {
- Context "Without Cache" {
- }
- Context "With Cache" {
- $cache = @{
- "file1.txt" = [PSCustomObject]@{
- LastWriteTime = "2018/01/01 00:00:00"
- CreationTime = "2018/01/01 00:00:00"
- LastAccessTime = "2018/01/01 00:00:00"
- Length = 10
- }
- }
- ConvertTo-Json $cache | OUt-File "cache_test.json"
- It "can detect difference" {
- $result = Check-Files -cache_file "cache_test.json"
- $result | Should BeLikeExactly '*LastWriteTime*'
- }
- }
- Context "DecodeBody" {
- It "can decode" -TestCases @(
- @{ CSet = 'UTF-8'; Enc = 'quoted-printable'; Raw = '=E6=97=A5=E6=9C=AC'; Expected = '日本' }
- ) {
- param ($CSet, $Enc, $Raw, $Expected)
- #DecodeBody $Raw $CSet $Enc | Should Be $Expected
- }
- }
- }
Add Comment
Please, Sign In to add comment