Sha256: 0cdaf214c88bae5ef561d1ceb4f651cb9e4cf6df8f576809c4f16cc057c0aacb
Contents?: true
Size: 1.74 KB
Versions: 1
Compression:
Stored size: 1.74 KB
Contents
Before do step "I have github instance" end When /^(.*) within a cassette named "([^"]*)"$/ do |step_to_call, cassette_name| VCR.use_cassette(cassette_name) { step step_to_call } end Then /^the response should equal (.*)$/ do |expected_response| expected = case expected_response when /t/ true when /f/ false else raise ArgumentError 'Expected boolean type!' end @response.should == expected end Then /^the response status should be (.*)$/ do |expected_response| @response.status.should eql expected_response.to_i end Then /^the response should be (.*)$/ do |expected_response| expected_response = case expected_response when /false/ false when /true/ true when /\d+/ expected_response.to_i when /empty/ [] else expected_response end @response.should eql expected_response end Then /^the response type should be (.*)$/ do |type| case type.downcase when 'json' @response.content_type.should =~ /application\/json/ when 'html' @response.content_type.should =~ /text\/html/ when 'raw' @response.content_type.should =~ /raw/ end end Then /^the response should have (\d+) items$/ do |size| @response.size.should eql size.to_i end Then /^the response should not be empty$/ do @response.should_not be_empty end Then /^the response should contain (.*)$/ do |item| case @response.body when Array @response.body.should include item end end Then /^the response should contain:$/ do |string| unescape(@response.body).should include(unescape(string)) end Then /^the response (.*) link should contain:$/ do |type, table| table.hashes.each do |attributes| attributes.each do |key, val| @response.links.send(:"#{type}").should match /#{key}=#{val}/ end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
github_api-0.8.3 | features/step_definitions/common_steps.rb |