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
In our tests, we make use of rspec's before/after/around lifecycle hooks to set the state of the test, including configatron settings with configatron.temp. Unfortunately when you have multiple configatron.temp competing with each other (one wrapping the other basically), it produces some results that we didn't expect:
[3] pry(main)> configatron.foo = 1
1
[4] pry(main)> configatron.temp do
[4] pry(main)* configatron.foo = 2
[4] pry(main)* configatron.temp do
[4] pry(main)* configatron.foo = 3
[4] pry(main)* end
[4] pry(main)* end
3
[5] pry(main)>
[6] pry(main)> configatron.foo
2
In this example, our our tests assumed that the settings would be returned to their original state, which in this example would be configatron.foo = 1
Is there a more elegant way to achieve what we want here with temp? In the short term, we've restored to manually holding the state of the variable we are setting and then resetting it at the end of the before/around block
The text was updated successfully, but these errors were encountered:
In our tests, we make use of rspec's before/after/around lifecycle hooks to set the state of the test, including configatron settings with
configatron.temp
. Unfortunately when you have multipleconfigatron.temp
competing with each other (one wrapping the other basically), it produces some results that we didn't expect:In this example, our our tests assumed that the settings would be returned to their original state, which in this example would be
configatron.foo = 1
Is there a more elegant way to achieve what we want here with
temp
? In the short term, we've restored to manually holding the state of the variable we are setting and then resetting it at the end of thebefore
/around
blockThe text was updated successfully, but these errors were encountered: