Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Block direct modification of Value-property in configuration options #1994

Merged
merged 1 commit into from Jun 15, 2021

Conversation

fflaten
Copy link
Collaborator

@fflaten fflaten commented Jun 15, 2021

PR Summary

Makes the setter of Value-property in configuration options private. This is done because modifying Value directly won't flip the internal _isOriginalValue-flag used to detect whether a user has modified the option. This is important to know which values to override when merging configuration.

Fix #1971

Possible breaking change: Users may create their advanced configurations by modifying Value directly because it has been possible or because it can be easier in certain scenarios, ex.

$c.Debug.WriteDebugMessagesFrom.Value += 'MyForgottenCategory'
# vs after PR
$c.Debug.WriteDebugMessagesFrom = $c.Debug.WriteDebugMessagesFrom.Value + @('MyForgottenCategory')

PR Checklist

  • PR has meaningful title
  • Summary describes changes
  • PR is ready to be merged
    • If not, use the arrow next to Create Pull Request to mark it as a draft. PR can be marked Ready for review when it's ready.
  • Tests are added/update (if required)
  • Documentation is updated/added (if required)

@nohwnd nohwnd merged commit bbc4730 into pester:main Jun 15, 2021
@fflaten fflaten deleted the fix-isoriginalvalue branch June 15, 2021 19:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Configuration option reports originalvalue true after modification
2 participants