Skip to content
This repository has been archived by the owner on Sep 4, 2020. It is now read-only.

Use AST to pull a test's $Desired value #191

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

brianbunke
Copy link
Contributor

New-VesterConfig needs to ask each Vest what its config value should be named. To do this, I used RegEx. (I like RegEx, but this is true.)

To fix #178, I employed my new best friend, PowerShell's AST. Private function Get-VestConfigValue now handles this work. New-VesterConfig has been updated with the changes, and Set-VesterConfigValue has been updated to no longer expect the $Matches variable.

(.md files will merge in with the other PR)

@brianbunke brianbunke mentioned this pull request Oct 10, 2017
@brianbunke brianbunke requested a review from chriswahl October 10, 2017 04:46
Copy link
Member

@chriswahl chriswahl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this will ultimately conflict with the concern I pointed out in PR #190 since this builds from that. I'll approve this so you can get the new code in (and it looks super snazzy) and you can then address the minor fix for the link in #190. :shipit:

@@ -210,31 +210,17 @@ function New-VesterConfig {
Default {$null}
}

# TODO: Should probably offload this to a private function
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Glad to see this happened. :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While I'm super happy with how this PR turned out, and how much freaking work I'll be doing with the AST moving forward...I think you found the easter egg I was most excited about. 👌

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve New-VesterConfig $Desired RegEx
2 participants