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
I use Spork for BDD purposes, and along with that I also use cover_me (which in turn uses configatron for configuration). My tests prematurely abort with an exception saying “at_exit” was a protected parameter so I did some digging.
Configatron checks existing methods to make sure configuration keys don’t overlap. Spork overrides #at_exit, essentially making methods_include?(:at_exit) in Configatron return true (which it should not). This becomes an issue when cover_me tries to set a default value for #at_exit configuration value, resulting in a ProtectedParameter exception.
I’m not even sure which gem to adress this issue to. I did try to fix it in Spork, but eventually it lead me to monkey patch the cover_me out of frustration instead.
The text was updated successfully, but these errors were encountered:
I’m terribly sorry, it was very bad of me to forget to include the mentioned monkey patch. I do not remember what the monkey patch was. I did look at it again, however, and believe something like this might work:
class Configatron
class Store
alias_method :orig_methods_include?, :methods_include?
def methods_include?(name)
return false if name.to_s == "at_exit"
orig_methods_include?(name)
end
end
end
Do note that this is untested, but I believe it might work.
I use Spork for BDD purposes, and along with that I also use cover_me (which in turn uses configatron for configuration). My tests prematurely abort with an exception saying “at_exit” was a protected parameter so I did some digging.
Configatron checks existing methods to make sure configuration keys don’t overlap. Spork overrides #at_exit, essentially making
methods_include?(:at_exit)
in Configatron return true (which it should not). This becomes an issue when cover_me tries to set a default value for #at_exit configuration value, resulting in a ProtectedParameter exception.I’m not even sure which gem to adress this issue to. I did try to fix it in Spork, but eventually it lead me to monkey patch the cover_me out of frustration instead.
The text was updated successfully, but these errors were encountered: