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

Interactions in when blocks are not preserved #1761

Closed
wants to merge 1 commit into from

Conversation

AndreasTu
Copy link
Member

@AndreasTu AndreasTu commented Aug 14, 2023

Interactions in a when: block were not active after the following then: block, if the then: block contained an interactions.

Now the SpecRewriter inserts a "freezeScope" after the moved interactions from then blocks.
This let the MockController skip the scope and use the outer scope for the interactions from the when block code.

This fixes #1759

Interactions in a when: block were not active after the
following then: block, if the then: block contained
an interactions.

Now the SpecRewriter inserts a "freezeScope" after
the moved interactions from then blocks.
This let the MockController skip the scope and
use the outer scope for the interactions from the
when block code.

This fixes spockframework#1759
AndreasTu added a commit to AndreasTu/spock that referenced this pull request Aug 14, 2023
@codecov
Copy link

codecov bot commented Aug 14, 2023

Codecov Report

Patch coverage: 89.47% and project coverage change: +0.01% 🎉

Comparison is base (e3ec836) 79.76% compared to head (3220310) 79.77%.

Additional details and impacted files
@@             Coverage Diff              @@
##             master    #1761      +/-   ##
============================================
+ Coverage     79.76%   79.77%   +0.01%     
- Complexity     4054     4062       +8     
============================================
  Files           425      425              
  Lines         12886    12903      +17     
  Branches       1622     1624       +2     
============================================
+ Hits          10278    10294      +16     
  Misses         1999     1999              
- Partials        609      610       +1     
Files Changed Coverage Δ
...rg/spockframework/mock/runtime/MockController.java 95.23% <84.61%> (-4.77%) ⬇️
...java/org/spockframework/compiler/AstNodeCache.java 100.00% <100.00%> (ø)
...java/org/spockframework/compiler/SpecRewriter.java 93.73% <100.00%> (+0.03%) ⬆️
.../java/org/spockframework/compiler/model/Block.java 70.00% <100.00%> (+6.84%) ⬆️

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

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.

Interactions in when blocks are not preserved if the then block contains an interaction
1 participant