i'm having some troubles getting Webmock to work with Cucumber. I've
been using webmock with RSpec successfully and I think it is a great
framework. Now, I have some cucumber scenarios need some request
stubbing. However, for some reason, webmock doesn't "do" anything or I
may have missed something.
I have the following setup (cucumber 1.1.9 and webmock 1.8)
support/env.rb
require 'webmock/cucumber'
also tried (did not make a difference)
World(WebMock::API, WebMock::Matchers)
WebMock.disable_net_connect!
I my steps file has this:
Given /^I want to deploy a new system "([^"]*)"$/ do |arg1|
> i'm having some troubles getting Webmock to work with Cucumber. I've > been using webmock with RSpec successfully and I think it is a great > framework. Now, I have some cucumber scenarios need some request > stubbing. However, for some reason, webmock doesn't "do" anything or I > may have missed something.
> I have the following setup (cucumber 1.1.9 and webmock 1.8)
> support/env.rb
> require 'webmock/cucumber'
> also tried (did not make a difference) > World(WebMock::API, WebMock::Matchers) > WebMock.disable_net_connect!
> I my steps file has this:
> Given /^I want to deploy a new system "([^"]*)"$/ do |arg1|
I was not very clear, sorry. I mean I don't see my requests be intercepted. I use the rest-client gem, so I presume standard Ruby HTTP libs.
In RSpec, I saw all my non-intercepted requests being printed out to the console with a suggested stubbing code. This is also not happening with Cucumber, I see all my requests going out to the actual REST resources. I'm using the same stubbing code as in my "old" RSpect tests, but I have no luck.
Is there any debug options I can try in cucumber?
--Florian
On Feb 24, 2012, at 10:33 AM, Bartosz Blimke wrote:
> i'm having some troubles getting Webmock to work with Cucumber. I've > been using webmock with RSpec successfully and I think it is a great > framework. Now, I have some cucumber scenarios need some request > stubbing. However, for some reason, webmock doesn't "do" anything or I > may have missed something.
> I have the following setup (cucumber 1.1.9 and webmock 1.8)
> support/env.rb
> require 'webmock/cucumber'
> also tried (did not make a difference) > World(WebMock::API, WebMock::Matchers) > WebMock.disable_net_connect!
> I my steps file has this:
> Given /^I want to deploy a new system "([^"]*)"$/ do |arg1|
Weird. If WebMock is required it should reject all unstubbed requests by default.
WebMock is enabled in the process cucumber is running right? Is it possible you are making these requests from a separate process/server without webmock?
> I was not very clear, sorry. I mean I don't see my requests be > intercepted. I use the rest-client gem, so I presume standard Ruby HTTP > libs.
> In RSpec, I saw all my non-intercepted requests being printed out to the > console with a suggested stubbing code. This is also not happening with > Cucumber, I see all my requests going out to the actual REST resources. I'm > using the same stubbing code as in my "old" RSpect tests, but I have no > luck.
> Is there any debug options I can try in cucumber?
> --Florian
> On Feb 24, 2012, at 10:33 AM, Bartosz Blimke wrote:
> What do you mean by Webmock not doing anything?
> Are you getting errors or is webmock not intercepting any requests at all?
> What http client lib are you using?
> It's difficult to say without having a code to reproduce the problem.
>> i'm having some troubles getting Webmock to work with Cucumber. I've >> been using webmock with RSpec successfully and I think it is a great >> framework. Now, I have some cucumber scenarios need some request >> stubbing. However, for some reason, webmock doesn't "do" anything or I >> may have missed something.
>> I have the following setup (cucumber 1.1.9 and webmock 1.8)
>> support/env.rb
>> require 'webmock/cucumber'
>> also tried (did not make a difference) >> World(WebMock::API, WebMock::Matchers) >> WebMock.disable_net_connect!
>> I my steps file has this:
>> Given /^I want to deploy a new system "([^"]*)"$/ do |arg1|
Ouch, I guess I found the problem. I'm testing a CLI tool with cucumber and it run it in a separate process, that is why Webmock is not intercepting. Currently, I'm calling my cmd line took (based on Thor) like this:
> Weird. If WebMock is required it should reject all unstubbed requests by default.
> WebMock is enabled in the process cucumber is running right? Is it possible > you are making these requests from a separate process/server without webmock?
> Bartosz
> 2012/2/24 Florian Rosenberg <f.rosenb...@gmail.com> > I was not very clear, sorry. I mean I don't see my requests be intercepted. I use the rest-client gem, so I presume standard Ruby HTTP libs.
> In RSpec, I saw all my non-intercepted requests being printed out to the console with a suggested stubbing code. This is also not happening with Cucumber, I see all my requests going out to the actual REST resources. I'm using the same stubbing code as in my "old" RSpect tests, but I have no luck.
> Is there any debug options I can try in cucumber?
> --Florian
> On Feb 24, 2012, at 10:33 AM, Bartosz Blimke wrote:
>> What do you mean by Webmock not doing anything?
>> Are you getting errors or is webmock not intercepting any requests at all?
>> What http client lib are you using?
>> It's difficult to say without having a code to reproduce the problem.
>> i'm having some troubles getting Webmock to work with Cucumber. I've >> been using webmock with RSpec successfully and I think it is a great >> framework. Now, I have some cucumber scenarios need some request >> stubbing. However, for some reason, webmock doesn't "do" anything or I >> may have missed something.
>> I have the following setup (cucumber 1.1.9 and webmock 1.8)
>> support/env.rb
>> require 'webmock/cucumber'
>> also tried (did not make a difference) >> World(WebMock::API, WebMock::Matchers) >> WebMock.disable_net_connect!
>> I my steps file has this:
>> Given /^I want to deploy a new system "([^"]*)"$/ do |arg1|
> Ouch, I guess I found the problem. I'm testing a CLI tool with cucumber > and it run it in a separate process, that is why Webmock is not > intercepting. Currently, I'm calling my cmd line took (based on Thor) like > this:
> The CLI tools calls out via the REST client and I would like to stub these > request. Is there a way to make that happen?
> Regards, > -Florian
> On Feb 24, 2012, at 10:45 AM, Bartosz Blimke wrote:
> Weird. If WebMock is required it should reject all unstubbed requests by > default.
> WebMock is enabled in the process cucumber is running right? Is it possible > you are making these requests from a separate process/server without > webmock?
>> I was not very clear, sorry. I mean I don't see my requests be >> intercepted. I use the rest-client gem, so I presume standard Ruby HTTP >> libs.
>> In RSpec, I saw all my non-intercepted requests being printed out to the >> console with a suggested stubbing code. This is also not happening with >> Cucumber, I see all my requests going out to the actual REST resources. I'm >> using the same stubbing code as in my "old" RSpect tests, but I have no >> luck.
>> Is there any debug options I can try in cucumber?
>> --Florian
>> On Feb 24, 2012, at 10:33 AM, Bartosz Blimke wrote:
>> What do you mean by Webmock not doing anything?
>> Are you getting errors or is webmock not intercepting any requests at all?
>> What http client lib are you using?
>> It's difficult to say without having a code to reproduce the problem.
>>> i'm having some troubles getting Webmock to work with Cucumber. I've >>> been using webmock with RSpec successfully and I think it is a great >>> framework. Now, I have some cucumber scenarios need some request >>> stubbing. However, for some reason, webmock doesn't "do" anything or I >>> may have missed something.
>>> I have the following setup (cucumber 1.1.9 and webmock 1.8)
>>> support/env.rb
>>> require 'webmock/cucumber'
>>> also tried (did not make a difference) >>> World(WebMock::API, WebMock::Matchers) >>> WebMock.disable_net_connect!
>>> I my steps file has this:
>>> Given /^I want to deploy a new system "([^"]*)"$/ do |arg1|