Skip to content

Reset ENV between specs with ice_age - #739

Merged
DannyBen merged 1 commit into
bashly-framework:masterfrom
dpep:ice_age
Dec 6, 2026
Merged

DannyBen merged 1 commit into
bashly-framework:masterfrom
dpep:ice_age

Conversation

@dpep

@dpep dpep commented Dec 5, 2026

Copy link
Copy Markdown
Contributor

Same change as completely#106: add ice_age, which resets ENV after every example, and drop the manual ENV cleanup.

Two variables leak today:

  • BASHLY_TAB_INDENT: settings_spec.rb saves the original in let(:original_value), but let is lazy and only gets read in the after hook, after the example has set the variable. So the "restore" writes back "anything at all", and it stays set for every later spec.
  • BASHLY_SHELL: Commands::Shell#run sets it, and shell_spec.rb clears it by hand.

Nothing fails yet, but a spec that reads either one would pass or fail depending on run order. ice_age closes both leaks and automates the cleanups.

spec_helper already calls Bundler.require :default, :development, so it's one Gemfile line plus deletions.

@DannyBen

DannyBen commented Dec 5, 2026

Copy link
Copy Markdown
Member

Nice. Here the LoC save is smaller, but the added value is real.

@DannyBen

DannyBen commented Dec 5, 2026

Copy link
Copy Markdown
Member

@dpep, final for merge?

@dpep

dpep commented Dec 5, 2026

Copy link
Copy Markdown
Contributor Author

ready when you are @DannyBen !

as you said, not a huge LoC savings, but fixes a bug and removes some cognitive load / complexity (remembering to reset ENV)

@DannyBen
DannyBen merged commit ede42b8 into bashly-framework:master Dec 6, 2026
7 checks passed
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.

2 participants