Skip to content

Commit

Permalink
Ensure removal of constants in specs
Browse files Browse the repository at this point in the history
This ensures that even if the specs fail, they don't leak constants.
  • Loading branch information
jarednorman committed Jul 7, 2022
1 parent ade11ab commit 244c5c0
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions core/spec/lib/spree/core/stock_configuration_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

expect(subject).to be MyCoordinator

ensure
Object.send(:remove_const, :MyCoordinator)
end
end
Expand All @@ -35,6 +36,7 @@

expect(subject).to be MyEstimator

ensure
Object.send(:remove_const, :MyEstimator)
end
end
Expand All @@ -52,6 +54,7 @@

expect(subject).to be MyFilter

ensure
Object.send(:remove_const, :MyFilter)
end
end
Expand All @@ -69,6 +72,7 @@

expect(subject).to be MySorter

ensure
Object.send(:remove_const, :MySorter)
end
end
Expand All @@ -86,6 +90,7 @@

expect(subject).to be MyAllocator

ensure
Object.send(:remove_const, :MyAllocator)
end
end
Expand All @@ -103,6 +108,7 @@

expect(subject).to be MyInventoryUnitBuilder

ensure
Object.send(:remove_const, :MyInventoryUnitBuilder)
end
end
Expand All @@ -122,6 +128,7 @@

expect(subject).to be MyAvailabilityValidator

ensure
Object.send(:remove_const, :MyAvailabilityValidator)
end
end
Expand All @@ -141,6 +148,7 @@

expect(subject).to be MyInventoryValidator

ensure
Object.send(:remove_const, :MyInventoryValidator)
end
end
Expand Down

0 comments on commit 244c5c0

Please sign in to comment.