travis-ci/travis-worker — Issue #19: WebMock supported ?
Author: zedtux
Created: 2011-10-15 10:22:56+00:00
State: open

Hello,

In my Rails (3.1.0) application, I'm using [WebMock](https://github.com/bblimke/webmock) (1.7.6) with [Cucumber](https://github.com/cucumber/cucumber) (1.1.0) in order to mock HTTP requests.

On my local machine, all cucumber feature are passing, but on Travis-CI it fail for both ruby versions I'm using (1.9.2 and 1.9.3) for the step:

````ruby
Then a POST request should be sent to "http://sushi.japan-factory.jp/"
````
With the following exception:

The request POST http://sushi.japan-factory.jp/ was expected to execute 1 time but it executed 0 times

The following requests were made:

No requests were made.
============================================================ (RSpec::Expectations::ExpectationNotMetError)
./features/step_definitions/execution_steps.rb:26:in `/^(no|a|one|\d+) POST request should be sent to "([^"]+)"$/'
features/executions_list.feature:31:in `Then a POST request should be sent to "http://sushi.japan-factory.jp/"'

Here is the step definition:

````ruby
Then /^(no|a|one|\d+) POST request should be sent to "([^"]+)"$/ do |request_count, url|
request_count = case request_count
when "no"
0
when "a" || "one"
1
else
request_count
end
a_request(:post, url).should have_been_made.times(request_count)
end
````