July 2018
Beginner
552 pages
13h 18m
English
The context block is another grouping element that can be nested inside a Describe block. You can use the Context block to denote different contexts:
function LetItSnow{ param ([switch]$Delightful) if ($Delightful) { 'But the fire is so delightful' } else { 'Let it snow, let it snow, let it snow' }}Describe AnotherTest { Context 'The weather outside is frightful' { $testdata = 'But the fire is so delightful' It 'Should be delightful' { LetItSnow -Delightful | Should -Be $testdata } } Context "Seems there's no place to go" { $testdata = 'Let it snow, let it snow, let it snow' It 'Should snow' { LetItSnow | Should -Be $testdata } }}
Read now
Unlock full access