Skip to content
This repository
Browse code

Use PowerShell syntax highlighting in the readme file.

  • Loading branch information...
commit 22157987dde4e87550d776a6edb3df572f6a6dd8 1 parent d218c19
Artur Dryomov authored December 02, 2012

Showing 1 changed file with 41 additions and 37 deletions. Show diff stats Hide diff stats

  1. 78  README.md
78  README.md
Source Rendered
@@ -10,46 +10,50 @@ A Pester Test
10 10
 -------------
11 11
 BuildChanges.ps1
12 12
 
13  
-	function BuildIfChanged {
14  
-		$thisVersion=Get-Version
15  
-		$nextVersion=Get-NextVersion
16  
-		if($thisVersion -ne $nextVersion) {Build $nextVersion}
17  
-		return $nextVersion
18  
-	}
  13
+```powershell
  14
+function BuildIfChanged {
  15
+  $thisVersion=Get-Version
  16
+  $nextVersion=Get-NextVersion
  17
+  if($thisVersion -ne $nextVersion) {Build $nextVersion}
  18
+  return $nextVersion
  19
+}
  20
+```
19 21
 
20 22
 BuildChanges.Tests.ps1
21 23
 
22  
-    $here = Split-Path -Parent $MyInvocation.MyCommand.Path
23  
-    $sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".")
24  
-    . "$here\$sut"
25  
-
26  
-    Describe "BuildIfChanged" {
27  
-    	Context "When there are Changes" {
28  
-    		Mock Get-Version {return 1.1}
29  
-    		Mock Get-NextVersion {return 1.2}
30  
-    		Mock Build {} -Verifiable -ParameterFilter {$version -eq 1.2}
31  
-
32  
-    		$result = BuildIfChanged
33  
-
34  
-	        It "Builds the next version" {
35  
-	            Assert-VerifiableMocks
36  
-	        }
37  
-	        It "returns the next version number" {
38  
-	            $result.Should.Be(1.2)
39  
-	        }
40  
-        }
41  
-    	Context "When there are no Changes" {
42  
-    		Mock Get-Version -MockWith {return 1.1}
43  
-    		Mock Get-NextVersion -MockWith {return 1.1}
44  
-    		Mock Build {}
45  
-
46  
-    		$result = BuildIfChanged
47  
-
48  
-	        It "Should not build the next version" {
49  
-	            Assert-MockCalled Build -Times 0 -ParameterFilter{$version -eq 1.1}
50  
-	        }
51  
-        }
  24
+```powershell
  25
+$here = Split-Path -Parent $MyInvocation.MyCommand.Path
  26
+$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".")
  27
+. "$here\$sut"
  28
+
  29
+Describe "BuildIfChanged" {
  30
+  Context "When there are Changes" {
  31
+    Mock Get-Version {return 1.1}
  32
+    Mock Get-NextVersion {return 1.2}
  33
+    Mock Build {} -Verifiable -ParameterFilter {$version -eq 1.2}
  34
+
  35
+    $result = BuildIfChanged
  36
+
  37
+      It "Builds the next version" {
  38
+          Assert-VerifiableMocks
  39
+      }
  40
+      It "returns the next version number" {
  41
+          $result.Should.Be(1.2)
  42
+      }
52 43
     }
  44
+  Context "When there are no Changes" {
  45
+    Mock Get-Version -MockWith {return 1.1}
  46
+    Mock Get-NextVersion -MockWith {return 1.1}
  47
+    Mock Build {}
  48
+
  49
+    $result = BuildIfChanged
  50
+
  51
+      It "Should not build the next version" {
  52
+          Assert-MockCalled Build -Times 0 -ParameterFilter{$version -eq 1.1}
  53
+      }
  54
+    }
  55
+}
  56
+```
53 57
 
54 58
 Running Tests
55 59
 -------------
@@ -75,4 +79,4 @@ Some further reading and resources:
75 79
 * [pester-bdd-for-the-system-administrator](http://scottmuc.com/blog/development/pester-bdd-for-the-system-administrator/)
76 80
 * [The Wiki](https://github.com/pester/Pester/wiki)
77 81
 * [Google Discussion Group](https://groups.google.com/forum/?fromgroups#!forum/pester)
78  
-* `C:\PS> Import-Module ./pester.psm1; Get-Help about_pester`
  82
+* `C:\PS> Import-Module ./pester.psm1; Get-Help about_pester`

0 notes on commit 2215798

Please sign in to comment.
Something went wrong with that request. Please try again.