-
-
Save wallace/565231 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# config/initializers/cucumber_fakeweb_hook.rb | |
# If this looks like a test server process, make its FakeWeb available to other | |
# processes via DRb. That way Cucumber (which runs in a separate process) can | |
# dynamically register stubs for this server to use. | |
if Rails.env =~ /^culerity/ | |
require 'drb' | |
require 'fakeweb' | |
DRb.start_service("druby://localhost:30010", FakeWeb) | |
puts "=> FakeWeb is available at #{DRb.uri}" | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# features/support/env.rb | |
require 'drb' | |
DRb.start_service | |
$remote_fakeweb = DRbObject.new(nil, "druby://localhost:30010") | |
# Clean FakeWeb's registry before each scenario | |
Before do | |
$remote_fakeweb.clean_registry | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# features/step_definitions/fakeweb_steps.rb | |
Given "the example site responds with a 200 OK" do | |
$remote_fakeweb.register_uri(:get, "http://example.com", :status => [200, "OK"]) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment