jdliss / shoulda-callback-matchers

Test existence of your Rails callbacks without having to call them
MIT License
134 stars 18 forks source link

Conflict with i18n-spec #8

Closed shedd closed 10 years ago

shedd commented 10 years ago

There seems to be a conflict between this gem and i18n-spec

I had i18n-spec installed first. My tests using it run fine. When I comment i18n-spec out in my gemfile, my tests using shoulda-callback-matchers run fine.

When I run my tests with both of these gems installed together, I get the following error:

            /usr/local/rvm/gems/ruby-2.1.2/gems/i18n-spec-0.4.1/lib/i18n-spec/matchers/have_valid_pluralization_keys_matcher.rb:1:in `<top (required)>': undefined method `define' for RSpec::Matchers:Module (NoMethodError)
            from /usr/local/rvm/gems/ruby-2.1.2/gems/skylight-0.3.13/lib/skylight/probes.rb:81:in `require'
            from /usr/local/rvm/gems/ruby-2.1.2/gems/skylight-0.3.13/lib/skylight/probes.rb:81:in `require'
            from /usr/local/rvm/gems/ruby-2.1.2/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:247:in `block in require'
            from /usr/local/rvm/gems/ruby-2.1.2/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:232:in `load_dependency'
            from /usr/local/rvm/gems/ruby-2.1.2/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:247:in `require'
            from /usr/local/rvm/gems/ruby-2.1.2/gems/i18n-spec-0.4.1/lib/i18n-spec.rb:8:in `block in <top (required)>'
            from /usr/local/rvm/gems/ruby-2.1.2/gems/i18n-spec-0.4.1/lib/i18n-spec.rb:8:in `each'
            from /usr/local/rvm/gems/ruby-2.1.2/gems/i18n-spec-0.4.1/lib/i18n-spec.rb:8:in `<top (required)>'
            from /usr/local/rvm/gems/ruby-2.1.2@global/gems/bundler-1.6.2/lib/bundler/runtime.rb:76:in `require'
            from /usr/local/rvm/gems/ruby-2.1.2@global/gems/bundler-1.6.2/lib/bundler/runtime.rb:76:in `block (2 levels) in require'
            from /usr/local/rvm/gems/ruby-2.1.2@global/gems/bundler-1.6.2/lib/bundler/runtime.rb:72:in `each'
            from /usr/local/rvm/gems/ruby-2.1.2@global/gems/bundler-1.6.2/lib/bundler/runtime.rb:72:in `block in require'
            from /usr/local/rvm/gems/ruby-2.1.2@global/gems/bundler-1.6.2/lib/bundler/runtime.rb:61:in `each'
            from /usr/local/rvm/gems/ruby-2.1.2@global/gems/bundler-1.6.2/lib/bundler/runtime.rb:61:in `require'
            from /usr/local/rvm/gems/ruby-2.1.2@global/gems/bundler-1.6.2/lib/bundler.rb:132:in `require'
            from /vagrant/config/application.rb:7:in `<top (required)>'
            ....

Not sure which gem is at fault, but this appeared after I installed shoulda-callback-matchers.

beatrichartz commented 10 years ago

Interesting, though I'm not sure where this comes from. The only touching point between Rspec::Matchers and shoulda-callback-matchers is the added method callback.

When I load i18n-spec into the gem specs and run them they still work fine. Could you give me a quick step by step how to reproduce the issue?

beatrichartz commented 10 years ago

As there are no new comments I assume this got solved. Feel free to reopen.