burke / zeus

Boot any rails app in under a second.
MIT License
3.33k stars 231 forks source link

Undefined method 'any_instance' #604

Closed tland closed 7 years ago

tland commented 7 years ago

Hi,

zeus is not woking well with mini_test (5.1) and mocha (1.0.0) since we upgraded to rails 4.2.

I ran _zeus test testfile, and received an error (any_instance is a method implemented in Mocha::ClassMethods)

NoMethodError:         NoMethodError: undefined method `any_instance' for <SomeClass>:Class
            test/test_helper.rb:1715:in `<some_method>'

I narrowed it down to the following line in mocha-1.0.0/lib/mocha/api.rb.

    def self.included(mod)
      Object.send(:include, Mocha::ObjectMethods)
      Module.send(:include, Mocha::ModuleMethods)
      Class.send(:include, Mocha::ClassMethods)           <==== 
    end

class methods are not included into Class at all.

It is fine if I run _ruby test testfile.

Thanks,

sideshowcoder commented 7 years ago

I'm running a setup very close to yours (mocha 1.1.0, rails 4.2.1, minitest 5.1) and it seems to work for me so I'm a little baffled how to reproduce this :crying_cat_face: maybe take a look at this app https://github.com/sideshowcoder/pressevent where it seems to work and let me know if there is anyway else I can help, feel free to reopen if the issue persists.