Module: Rectory

Defined in:
lib/rectory.rb,
lib/rectory/request.rb,
lib/rectory/version.rb,
lib/rectory/expectation.rb,
lib/rectory/csv_outputter.rb

Defined Under Namespace

Classes: CsvOutputter, Expectation, Request

Constant Summary collapse

DEFAULT_CELLULOID_OPTIONS =
{
  :pool => 10
}
VERSION =
"0.0.2"

Class Method Summary collapse

Class Method Details

.perform(expectations, options = {}) ⇒ Array

Test the expectated results of an some HTTP requests

Utilizes celluloid pooling futures for speed.



21
22
23
24
25
26
# File 'lib/rectory.rb', line 21

def self.perform(expectations, options = {})
  options = DEFAULT_CELLULOID_OPTIONS.merge options
  pool    = Rectory::Request.pool(options)
  futures = expectations.map { |e| pool.future(:perform, e) }
  results = futures.map(&:value)
end