-
Notifications
You must be signed in to change notification settings - Fork 187
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Prevent
ConvertTo-SmarterObject
from flattening arrays (#56)
* Ensure that `ConvertTo-SmarterObject` does not cause any side-effects on `InputObject` * Ensure that `ConvertTo-SmarterObject` does not flatten any arrays * Switched all calls of `ConvertTo-Json` to not use pipelining in order to avoid PowerShell's array-flattening logic when piping the InputObject in, as opposed to when passing it as a parameter. * Ensured that we do best-effort Date conversion in `ConvertTo-SmarterObject` (a failed date conversion should never cause an exception/failure). * Used a workaround described in [Pester's Wiki](# https://github.com/pester/Pester/wiki/Testing-different-module-types) to force the module to be a `Script Module` instead of a `Manifest Module` so that `Mock` and `InModuleScope` (which lets you test private methods) work. * Added UT's for `ConvertTo-SmarterObject` core scenarios. Resolves PowerShell#55: ConvertTo-SmarterObject is flattening arrays Thanks to @danbelcher-MSFT for the assist on this one.
- Loading branch information
1 parent
35b06ce
commit 6cf344f
Showing
11 changed files
with
315 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# This file only exists to enable making this a "Script" module instead of a "Manifest" module | ||
# so that Pester tests are able to use Pester's Mock and InModuleScope features for internal | ||
# methods. For more information, refer to: | ||
# https://github.com/pester/Pester/wiki/Testing-different-module-types |
Oops, something went wrong.