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

Add check to prevent double global mocking #1792

Merged

Conversation

leonard84
Copy link
Member

Previous to this commit, it was possible to create a global
GroovyMock/Stub/Spy for a type that was already a global mock,
this is problematic and leaked the modified meta-class.

Previous to this commit, it was possible to create a global
GroovyMock/Stub/Spy for a type that was already a global mock,
this is problematic and leaked the modified meta-class.
@leonard84 leonard84 self-assigned this Sep 15, 2023
@codecov
Copy link

codecov bot commented Sep 15, 2023

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (36c984d) 79.87% compared to head (6b2e4c6) 79.87%.

Additional details and impacted files
@@            Coverage Diff            @@
##             master    #1792   +/-   ##
=========================================
  Coverage     79.87%   79.87%           
- Complexity     4096     4100    +4     
=========================================
  Files           425      425           
  Lines         12967    12969    +2     
  Branches       1643     1644    +1     
=========================================
+ Hits          10357    10359    +2     
  Misses         1998     1998           
  Partials        612      612           
Files Changed Coverage Δ
...spockframework/mock/runtime/GroovyMockFactory.java 73.68% <100.00%> (+1.46%) ⬆️

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@leonard84 leonard84 merged commit 75ac394 into spockframework:master Sep 15, 2023
21 checks passed
@leonard84 leonard84 deleted the prevent-double-global-mocking branch September 15, 2023 17:20
leonard84 added a commit that referenced this pull request Sep 15, 2023
leonard84 added a commit to leonard84/spock that referenced this pull request Sep 15, 2023
Previous to this commit, it was possible to create a global
GroovyMock/Stub/Spy for a type that was already a global mock,
this is problematic and leaked the modified meta-class.

(cherry picked from commit 75ac394)
@leonard84 leonard84 added this to the 2.4-M2 milestone Feb 22, 2024
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.

1 participant