@@ -54,6 +54,8 @@ Mock -CommandName Get-SamplerAbsolutePath -ParameterFilter {
54
54
)
55
55
}
56
56
57
+ $script :mockGetSamplerBuiltModuleManifestReturnValue =
58
+
57
59
Mock - CommandName Get-SamplerBuiltModuleManifest - MockWith {
58
60
return (
59
61
Join-Path - Path $TestDrive - ChildPath ' output' |
@@ -64,6 +66,28 @@ Mock -CommandName Get-SamplerBuiltModuleManifest -MockWith {
64
66
)
65
67
}
66
68
69
+ # This is called after the mock of Get-SamplerBuiltModuleManifest
70
+ Mock - CommandName Get-Item - MockWith {
71
+ return @ {
72
+ FullName = (
73
+ Join-Path - Path $TestDrive - ChildPath ' output' |
74
+ Join-Path - ChildPath ' builtModule' |
75
+ Join-Path - ChildPath ' MyModule' |
76
+ Join-Path - ChildPath ' 2.0.0' |
77
+ Join-Path - ChildPath ' MyModule.psd1'
78
+ )
79
+ }
80
+ } - ParameterFilter {
81
+ # Must be the same path that the mock for Get-SamplerBuiltModuleManifest returns.
82
+ $Path -contains (
83
+ Join-Path - Path $TestDrive - ChildPath ' output' |
84
+ Join-Path - ChildPath ' builtModule' |
85
+ Join-Path - ChildPath ' MyModule' |
86
+ Join-Path - ChildPath ' 2.0.0' |
87
+ Join-Path - ChildPath ' MyModule.psd1'
88
+ )
89
+ }
90
+
67
91
Mock - CommandName Get-SamplerBuiltModuleBase - MockWith {
68
92
return (
69
93
Join-Path - Path $TestDrive - ChildPath ' output' |
@@ -73,6 +97,26 @@ Mock -CommandName Get-SamplerBuiltModuleBase -MockWith {
73
97
)
74
98
}
75
99
100
+ # This is called after the mock of Get-SamplerBuiltModuleBase
101
+ Mock - CommandName Get-Item - MockWith {
102
+ @ {
103
+ FullName = (
104
+ Join-Path - Path $TestDrive - ChildPath ' output' |
105
+ Join-Path - ChildPath ' builtModule' |
106
+ Join-Path - ChildPath ' MyModule' |
107
+ Join-Path - ChildPath ' 2.0.0'
108
+ )
109
+ }
110
+ } - ParameterFilter {
111
+ # Must be the same path that the mock for Get-SamplerBuiltModuleManifest returns.
112
+ $Path -contains (
113
+ Join-Path - Path $TestDrive - ChildPath ' output' |
114
+ Join-Path - ChildPath ' builtModule' |
115
+ Join-Path - ChildPath ' MyModule' |
116
+ Join-Path - ChildPath ' 2.0.0'
117
+ )
118
+ }
119
+
76
120
Mock - CommandName Get-BuiltModuleVersion - MockWith {
77
121
return ' 2.0.0'
78
122
}
@@ -87,6 +131,28 @@ Mock -CommandName Get-SamplerModuleRootPath -MockWith {
87
131
)
88
132
}
89
133
134
+ # This is called after the mock of Get-SamplerModuleRootPath
135
+ Mock - CommandName Get-Item - MockWith {
136
+ @ {
137
+ FullName = (
138
+ Join-Path - Path $TestDrive - ChildPath ' output' |
139
+ Join-Path - ChildPath ' builtModule' |
140
+ Join-Path - ChildPath ' MyModule' |
141
+ Join-Path - ChildPath ' 2.0.0' |
142
+ Join-Path - ChildPath ' MyModule.psm1'
143
+ )
144
+ }
145
+ } - ParameterFilter {
146
+ # Must be the same path that the mock for Get-SamplerBuiltModuleManifest returns.
147
+ $Path -contains (
148
+ Join-Path - Path $TestDrive - ChildPath ' output' |
149
+ Join-Path - ChildPath ' builtModule' |
150
+ Join-Path - ChildPath ' MyModule' |
151
+ Join-Path - ChildPath ' 2.0.0' |
152
+ Join-Path - ChildPath ' MyModule.psm1'
153
+ )
154
+ }
155
+
90
156
# This is only used when calling Set-SamplerTaskVariable with parameter -AsNewBuild
91
157
Mock - CommandName Get-BuildVersion - MockWith {
92
158
return ' 2.0.0'
0 commit comments