forked from dfinke/PowerShellNotebook
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGetNotebook.tests.ps1
More file actions
59 lines (46 loc) · 1.89 KB
/
Copy pathGetNotebook.tests.ps1
File metadata and controls
59 lines (46 loc) · 1.89 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#Import-Module $PSScriptRoot\..\PowerShellNotebook.psd1 -Force
Describe "Test PS Notebooks" {
It "Should have Get-Notebook" {
$actual = Get-Command Get-Notebook -ErrorAction SilentlyContinue
$actual | Should -Not -Be $Null
}
It "Should find no notebooks" {
$actual = Get-Notebook
$actual.Count | Should -Be 0
}
It "Should find no notebooks in specified directory" {
$actual = Get-Notebook $PSScriptRoot\NoNotebooks
$actual.Count | Should -Be 0
}
It "Should find one notebook in specified directory" {
$actual = @(Get-Notebook "$PSScriptRoot\OneNotebook")
$actual.Count | Should -Be 1
}
It "Should find notebooks in specified directory" {
$actual = @(Get-Notebook "$PSScriptRoot\GoodNotebooks")
$actual.Count | Should -Be 6
}
It "Should find a notebook by name in specified directory" {
$actual = @(Get-Notebook "$PSScriptRoot\GoodNotebooks" testpsnb1*)
$actual.Count | Should -Be 1
}
It "Should find a notebook by name in specified directory" {
$actual = @(Get-Notebook "$PSScriptRoot\GoodNotebooks" testpsnb1*)
$actual.Count | Should -Be 1
}
It "Should find notebook testpsnb1.ipynb and get metadata content" {
$actual = @(Get-Notebook "$PSScriptRoot\GoodNotebooks" testpsnb1*)
$actual.Count | Should -Be 1
<#
NoteBookName : testPSNb1.ipynb
KernelName : powershell
CodeBlocks : 2
MarkdownBlocks : 1
NoteBookFullName : C:\Users\Douglas\Documents\GitHub\MyPrivateGit\PowerShellNotebook\__tests__\GoodNotebooks\testPSNb1.ipynb
#>
$actual.NoteBookName | Should -Be "testPSNb1.ipynb"
$actual.KernelName | Should -Be "powershell"
$actual.CodeBlocks | Should -Be 2
$actual.MarkdownBlocks | Should -Be 1
}
}