You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is the 2nd leg of my proposal to unbundle the cheats from the assertions. Here I'll assume that you have read the 1st leg.
The fact that the custom cheats are added in the same namespace as the testing assertions has two inconveniences.
The API is inconsistent. Users need to remember that certain cheats are available only via the vm variable, while others are to be found in the default namespace of Test. For example, vm.startPrank and changePrank.
I have begun working on this on the refactor-cheats-2 branch of my fork, but it's not done yet (I couldn't get the prank tests to pass). Happy to open a PR so we can discuss the issues I stumbled upon if there is interest for making this proposed change.
Description
This is the 2nd leg of my proposal to unbundle the cheats from the assertions. Here I'll assume that you have read the 1st leg.
The fact that the custom cheats are added in the same namespace as the testing assertions has two inconveniences.
vm
variable, while others are to be found in the default namespace ofTest
. For example,vm.startPrank
andchangePrank
.bound
internal virtual
#92.Solution
Instead of inheriting from
Cheats
inTest
, we create an instance ofCheats
inTest
:The
vm
would have to be re-instantiated inTest
, but IMO that's a fair price to pay.This way, users would know that all custom cheats offered by Forge Std are available only via
cheats
, and the namespace would be tidier.The text was updated successfully, but these errors were encountered: