Skip to content

Commit ba8e7fb

Browse files
author
James Brundage
committed
Adding tests for Update-PipeScript
1 parent 673a69b commit ba8e7fb

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

Update-PipeScript.tests.ps1

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
describe Update-PipeScript {
2+
context 'Updating ScriptBlocks' {
3+
it 'Can rename a variable' {
4+
Update-PipeScript -ScriptBlock { $v } -RenameVariable @{v='x'} |
5+
Should -BeLike '*$x*'
6+
}
7+
}
8+
9+
context 'Updating text' {
10+
it 'Can -InsertBefore' {
11+
Update-PipeScript -ScriptBlock { "world" } -InsertBefore @{'world'= 'hello '} |
12+
Should -BeLike '*"hello world"*'
13+
}
14+
15+
it 'Can -InsertAfter' {
16+
Update-PipeScript -ScriptBlock { "hello" } -InsertAfter @{"hello" = " world"} |
17+
Should -BeLike '*"hello world"*'
18+
}
19+
}
20+
}

0 commit comments

Comments
 (0)