Replicant is a Rack-based http-endpoint Gem I use in tests along with
automation frameworks such as Watir, Selenium, or any framework which
does not rely on Net:HTTP, and therefore cannot be mock'd using normal
methods. It acts as a real http endpoint that can assert specific
requests occurred with the expected post data. It's not close to being
"done", but go ahead and take a look anyway.
Sample Usage:
require 'replicant'
before do
@mock_website = Replicant.new
@mock_website.response( :login_page, "/login",
%q{
context "when logging in" do
before do
# Your code which runs Watir/Selenium/or anything else that doesn't use Net::HTTP here
end
it "accesses the login page" do
@mock_website.should receive_request_for( :login_page )
end
it "posts to the session page" do
@mock_website.should receive_post_for( :session_page ).with_data( "user" => "sample_user", "password" => "password" )
end
end
FAQs
Unknown package
We found that replicant demonstrated a not healthy version release cadence and project activity because the last version was released a year ago.It has 1 open source maintainer collaborating on the project.
Package last updated on 03 Oct 2011
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.