No commit activity in last 3 years
No release in over 3 years
Provides a client for the control interface of holoserve and some RSpec matchers.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

Runtime

 Project Readme

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