Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spork breaks Configatron gem, unable to run tests with coverage support #67

Open
Burgestrand opened this issue Nov 24, 2010 · 3 comments

Comments

@Burgestrand
Copy link

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.

@tecnobrat
Copy link

What was the monkey patch you used as a workaround?

@Burgestrand
Copy link
Author

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.

@belt
Copy link

belt commented Nov 13, 2012

Spork has nothing to do with this issue. I do not use spork and experience the same symptoms.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants