Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Ruby
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
features upgraded to holoserve version 0.4.4
lib
spec
tasks
.gitignore
Gemfile
Gemfile.lock
LICENSE
README.rdoc
Rakefile
holoserve-connector.gemspec
holoserve-connector.iml

README.rdoc

Holoserve Connector - Connector library for Holoserve.

This library provides a client to the control interface of Holoserve and RSpec matchers to integrate Holoserve in a test suite. See holoserve for details about the concept of Holoserve.

Example

require 'holoserve/connector'
require 'transport'

holoserve = Holoserve::Connector.new :host => "localhost"

holoserve.state.set :name => "one"

Transport::HTTP.request :post, "/test"     # handled in test layout one
Transport::HTTP.request :delete, "/test"   # unhandled

holoserve.history.pair_ids
# => [ "test_requested" ]

holoserve.bucket.requsts
# => [ { "method" => "DELETE", :path => "/test", :headers => { ... } } ]

RSpec inetgration example

require 'rspec/holoserve'

RSpec::Holoserve.run_server = true

describe "RSpec matchers" do

  before :all do
    @client = Holoserve::Connector.new
    @client.pairs.upload File.expand_path(File.join(File.dirname(__FILE__), "..", "..", "pairs", "test.yaml"))
    @client.situation.name = "one"
  end

  it "should test if holoserve received a specified request" do
    Transport::HTTP.request :post, "http://localhost:4250/test", :expected_status_code => 201
    @client.should have_received("test_request")
  end

end
Something went wrong with that request. Please try again.