Sha256: 6d9fa98fd342fd11db0961a7f79b979a24874c5275b9c4dd6984db2dcfd3ea45

Contents?: true

Size: 1.54 KB

Versions: 1

Compression:

Stored size: 1.54 KB

Contents

When /^I GET "([^\"]*)"$/ do |uri|
  @result = record_exception { Recliner.get(uri) }
end

When /^I GET "([^\"]*)" with:$/ do |uri, params|
  params = eval_hash_keys(params.rows_hash)
  @result = record_exception { Recliner.get(uri, params) }
end

When /^I PUT to "([^\"]*)"$/ do |uri|
  @result = record_exception { Recliner.put(uri, {}) }
end

When /^I PUT to "([^\"]*)" with the revision$/ do |uri|
  @result = record_exception { Recliner.put(uri, { '_rev' => @revision }) }
end

When /^I POST to "([^\"]*)"$/ do |uri|
  @result = record_exception { Recliner.post(uri, {}) }
end

When /^I POST to "([^\"]*)" with:$/ do |uri, payload|
  @result = record_exception { Recliner.post(uri, eval(payload)) }
end

When /^I DELETE "([^\"]*)" with the revision$/ do |uri|
  @result = record_exception { Recliner.delete("#{uri}?rev=#{@revision}") }
end

When /^I DELETE "([^\"]*)"$/ do |uri|
  @result = record_exception { Recliner.delete(uri) }
end

Then /^the result should have key "([^\"]*)"$/ do |key|
  @exception.should be_nil
  @result.should have_key(key)
end

Then /^the result should have "([^\"]*)" => "([^\"]*)"$/ do |key, value|
  @exception.should be_nil
  @result[key].to_s.should == value
end

Then /^the result should have "([^\"]*)" matching "([^\"]*)"$/ do |key, regexp|
  @exception.should be_nil
  @result[key].should match(regexp)
end

Then /^a "([^\"]*)" exception should be raised$/ do |exception_class|
  @exception.should_not be_nil
  @exception.class.to_s.should == exception_class
end

Then /^no exception should be raised$/ do
  @exception.should be_nil
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
recliner-0.0.1 features/step_definitions/restful_steps.rb