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
[BUG] undefined method
define' for RSpec::Matchers:Module`
#16
Comments
This doesn't happen with Rspec 2.13 - something changed between 2.13 and 2.14 that changed this. If I just add |
This is on |
bah.. obviously the |
Upon some investigation: https://github.com/rspec/rspec/commit/15ef280ac74b03f612d6038f484d80226fb38e03 Removed explicitly requiring both expectations and mocks. So it should be fixable by: Removing require 'rspec' and adding require 'rspec/core'
require 'rspec/expectations'
require 'rspec/mocks' I'll get this in asap as a patch release. |
@JustinAiken I haven't actually been able to duplicate your issue, no matter where I require
And let me know if that fixes it, either that or paste a minimal |
@JustinAiken ping? |
Oh, haha... I was Yes confirmed - that fixes it :) |
hahaha... great thanks, I'll push a |
Also, this probably isn't needed since that PR fixes it, but for future reference, in case anybody has issues in the future and googles this: My spec_helper started with: require File.dirname(__FILE__) + "/../config/environment" unless defined?(Rails.root)
require 'shoulda'
require 'cancan/matchers'
require 'rspec/rails'
require 'timecop'
require 'webmock/rspec' ...and before this PR, failed unless I added |
This fixes issue #2, where this error would be thrown: undefined method define' for RSpec::Matchers:Module (NoMethodError)` From some googling, it looks like this commit in rspec might have caused the issue: https://github.com/rspec/rspec/commit/15ef280ac74b03f612d6038f484d80226fb38e03 That rspec commit was linked to from CanCanCommunity/cancancan#16 , where a similar fix seem to have helped. Change-Id: I420a68d34cb4ae7b0ec24ec6dbe433ac40b0ff9e Reviewed-on: http://gerrit.causes.com/41501 Tested-by: Henric Trotzig <henric.trotzig@brigade.com> Reviewed-by: Flarnie Marchan <flarnie.marchan@brigade.com>
Upon this line in my spec_helper:
I get this:
cancancan 1.70
Rails 3.2.17
Rspec 2.14.1
The text was updated successfully, but these errors were encountered: