Error with Cucumber using RSpec 2 & Rails 3 #56

Closed
nielsm opened this Issue Nov 2, 2010 · 9 comments

Comments

Projects
None yet
3 participants
@nielsm

nielsm commented Nov 2, 2010

I am getting an error while trying to run cucumber: undefined method `configure' for RSpec:Module (NoMethodError)

This happens after I followed the directions on the readme to add require 'webmock/rspec'
World(WebMock::API, WebMock::Matchers) to the env.rb file.

@bblimke

This comment has been minimized.

Show comment Hide comment
@bblimke

bblimke Nov 2, 2010

Owner

What version of RSpec exactly do you use?

Owner

bblimke commented Nov 2, 2010

What version of RSpec exactly do you use?

@nielsm

This comment has been minimized.

Show comment Hide comment
@nielsm

nielsm Nov 2, 2010

I've tried with both 2.0 & 2.0.1, with both Webmock 1.4 & 1.5. While the error between 1.4 & 1.5 is slightly different, it is conceptually similar with an error on configure.

nielsm commented Nov 2, 2010

I've tried with both 2.0 & 2.0.1, with both Webmock 1.4 & 1.5. While the error between 1.4 & 1.5 is slightly different, it is conceptually similar with an error on configure.

@bblimke

This comment has been minimized.

Show comment Hide comment
@bblimke

bblimke Nov 2, 2010

Owner

Looks like the same issue as this one
http://github.com/rspec/rspec-rails/pull/202

Doesn't seem like Cucumber like RSpec.configure works anymore with Cucumber.

I will have to try it and update webmock readme with the correct way of adding webmock to cucumber.

Owner

bblimke commented Nov 2, 2010

Looks like the same issue as this one
http://github.com/rspec/rspec-rails/pull/202

Doesn't seem like Cucumber like RSpec.configure works anymore with Cucumber.

I will have to try it and update webmock readme with the correct way of adding webmock to cucumber.

@jfernandez

This comment has been minimized.

Show comment Hide comment
@jfernandez

jfernandez Nov 3, 2010

I'm getting this error too with RSpec 1.3.1 and using the instructions to configure it for RSpec 1.x

Has RSpec 1.x support been removed in 1.5.0? If so you should update the README

I'm getting this error too with RSpec 1.3.1 and using the instructions to configure it for RSpec 1.x

Has RSpec 1.x support been removed in 1.5.0? If so you should update the README

@bblimke

This comment has been minimized.

Show comment Hide comment
@bblimke

bblimke Nov 3, 2010

Owner

Thanks for confirming that.

RSpec 1.x support was not removed and I'm not planning to remove it. WebMock internal specs were changed to RSpec 2 though.
Are you experiencing any problems using WebMock with RSpec 1.x?

Owner

bblimke commented Nov 3, 2010

Thanks for confirming that.

RSpec 1.x support was not removed and I'm not planning to remove it. WebMock internal specs were changed to RSpec 2 though.
Are you experiencing any problems using WebMock with RSpec 1.x?

@bblimke

This comment has been minimized.

Show comment Hide comment
@bblimke

bblimke Nov 3, 2010

Owner

Here is what currently has to be added to env.rb to make it working:

require 'webmock'
require 'webmock/adapters/rspec/request_pattern_matcher'
require 'webmock/adapters/rspec/webmock_matcher'
require 'webmock/adapters/rspec/matchers'

World(WebMock::API, WebMock::Matchers)

Before do
  WebMock.reset_webmock
end

This will work with version <=1.5, but it's a temporary workaround and it may not work in the future if the files will be rearranged.
I'm working on simplifying this process to something like require 'webmock/cucumber'

Owner

bblimke commented Nov 3, 2010

Here is what currently has to be added to env.rb to make it working:

require 'webmock'
require 'webmock/adapters/rspec/request_pattern_matcher'
require 'webmock/adapters/rspec/webmock_matcher'
require 'webmock/adapters/rspec/matchers'

World(WebMock::API, WebMock::Matchers)

Before do
  WebMock.reset_webmock
end

This will work with version <=1.5, but it's a temporary workaround and it may not work in the future if the files will be rearranged.
I'm working on simplifying this process to something like require 'webmock/cucumber'

@bblimke

This comment has been minimized.

Show comment Hide comment
@bblimke

bblimke Nov 3, 2010

Owner

Try the development version from github master.
Now you just need to add require 'webmock/cucumber.

Owner

bblimke commented Nov 3, 2010

Try the development version from github master.
Now you just need to add require 'webmock/cucumber.

@bblimke

This comment has been minimized.

Show comment Hide comment
@bblimke

bblimke Nov 7, 2010

Owner

I assume it now works with WebMock from github master.
If you still have problems, please reopen the issue.

Owner

bblimke commented Nov 7, 2010

I assume it now works with WebMock from github master.
If you still have problems, please reopen the issue.

@nielsm

This comment has been minimized.

Show comment Hide comment
@nielsm

nielsm Nov 13, 2010

This works for me in 1.6.1 as well. Thanks.

nielsm commented Nov 13, 2010

This works for me in 1.6.1 as well. Thanks.

This issue was closed.

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