@@ -89,6 +89,13 @@ Describe "Regression test for #84: Multiple Aliases per command will Export" -Ta
89
89
90
90
Describe " Supports building without a build.psd1" - Tag Integration {
91
91
Copy-Item $PSScriptRoot \Source1 TestDrive:\Source1 - Recurse
92
+ # This is the old build, with a build.psd1
93
+ $Output = Build-Module TestDrive:\Source1\build.psd1 - Passthru
94
+ $ManifestContent = Get-Content $Output.Path
95
+ $ModuleContent = Get-Content ([IO.Path ]::ChangeExtension($Output.Path , " .psm1" ))
96
+ Remove-Item (Split-Path $Output.Path ) - Recurse
97
+
98
+ # Then remove the build.psd1 and rebuild it
92
99
Remove-Item TestDrive:\Source1\build.psd1
93
100
94
101
$Build = @ { }
@@ -105,6 +112,8 @@ Describe "Supports building without a build.psd1" -Tag Integration {
105
112
106
113
It " Creates the same module as with a build.psd1" {
107
114
$Build.Metadata = Import-Metadata $Build.Output.Path
115
+ Get-Content $Build.Output.Path | Should - Be $ManifestContent
116
+ Get-Content ([IO.Path ]::ChangeExtension($Build.Output.Path , " .psm1" )) | Should - Be $ModuleContent
108
117
}
109
118
110
119
It " Should update AliasesToExport in the manifest" {
@@ -115,26 +124,30 @@ Describe "Supports building without a build.psd1" -Tag Integration {
115
124
$Build.Metadata.FunctionsToExport | Should - Be @ (" Get-Source" , " Set-Source" )
116
125
}
117
126
}
118
- Describe " Supports building without a build.psd1 and not specifying a module manifest " - Tag Integration {
127
+ Describe " Supports building discovering the module without a build.psd1" - Tag Integration {
119
128
Copy-Item $PSScriptRoot \Source1 TestDrive:\source - Recurse
129
+
130
+ # This is the old build, with a build.psd1
131
+ $Output = Build-Module TestDrive:\source\build.psd1 - Passthru
132
+ $ManifestContent = Get-Content $Output.Path
133
+ $ModuleContent = Get-Content ([IO.Path ]::ChangeExtension($Output.Path , " .psm1" ))
134
+ Remove-Item (Split-Path $Output.Path ) - Recurse
135
+
136
+ # Then remove the build.psd1 and rebuild it
120
137
Remove-Item TestDrive:\source\build.psd1
121
138
122
139
Push-Location - StackName ' IntegrationTest' - Path TestDrive:\
123
140
124
141
$Build = @ { }
125
142
126
143
It " No longer fails if there's no build.psd1" {
127
- $BuildParameters = @ {
128
- SourcePath = " TestDrive:\source"
129
- OutputDirectory = " TestDrive:\Result1"
130
- VersionedOutputDirectory = $true
131
- }
132
-
133
- $Build.Output = Build-Module @BuildParameters - Passthru
144
+ $Build.Output = Build-Module - Passthru
134
145
}
135
146
136
147
It " Creates the same module as with a build.psd1" {
137
148
$Build.Metadata = Import-Metadata $Build.Output.Path
149
+ Get-Content $Build.Output.Path | Should - Be $ManifestContent
150
+ Get-Content ([IO.Path ]::ChangeExtension($Build.Output.Path , " .psm1" )) | Should - Be $ModuleContent
138
151
}
139
152
140
153
It " Should update AliasesToExport in the manifest" {
0 commit comments