ticketmaster / poshspec

Infrastructure Testing DSL running in Pester
MIT License
183 stars 32 forks source link

Adds User Rights Assignment tests #36

Closed michaeltlombardi closed 8 years ago

michaeltlombardi commented 8 years ago
michaeltlombardi commented 8 years ago

It's a bit goofy, adding these tests, since it required adding a type into the public function. I reduced the surface area by chopping out all of the references I found to modifying the user rights assignments, leaving the ability only to retrieve them, never to modify them via tests.

VSCode can only do code folding via indentation so it looks a mess. I can refactor to use a separate private file if you want.

cdhunt commented 8 years ago

If it isn't a function a user would include in their tests, it should probably be in Private, but I think this is another very useful addition.

michaeltlombardi commented 8 years ago

I don't think users would access the functions or type directly; if they were going to do so, they'd probably want the full script/module and be able to set user rights as well as retrieve them.

Refactoring this to point to a private file containing the functions and type would definitely make UserRightsAssignment.ps1 cleaner to read at the minor expense of having to include an additional private file for one test.

michaeltlombardi commented 8 years ago

Other tests (AuditPolicy and Volume) currently have private functions included inside them to make the expression itself less convoluted.

michaeltlombardi commented 8 years ago

@cdhunt: Refactored to use private functions/cleaner coding.

michaeltlombardi commented 8 years ago

@cdhunt: Is anything further required to get this merged?

cdhunt commented 8 years ago

No, I can merge it, however, I'm still looking at issues in some other areas before I publish a new version.

michaeltlombardi commented 8 years ago

No worries - anything I can help with?