Sha256: 4b25211380a20054f758536527ae73028ca3a52abe742ee1975acc600959502a

Contents?: true

Size: 1.62 KB

Versions: 26

Compression:

Stored size: 1.62 KB

Contents

require File.dirname(__FILE__) + '/../spec_helper'
require 'resourceful'

describe Resourceful do

  describe ".get()" do
    it "should be performable on a resource and return a response" do
      response = Resourceful.get('http://localhost:42682/')
      response.should be_kind_of(Resourceful::Response)
    end  
  end

  describe ".post()" do
    it "should be performable on a resource and return a response" do
      response = Resourceful.post('http://localhost:42682/')
      response.should be_kind_of(Resourceful::Response)
    end
    
    it "should require Content-Type be set if a body is provided" do
      lambda {
        Resourceful.post('http://localhost:42682/', {}, 'body')
      }.should raise_error(Resourceful::MissingContentType)
    end
    
  end
  
  describe ".put()" do
    
    it "should be performable on a resource and return a response" do
      response = Resourceful.put('http://localhost:42682/')
        response.should be_kind_of(Resourceful::Response)
    end
    
    it "should require Content-Type be set if a body is provided" do
      lambda {
        Resourceful.put('http://localhost:42682/', "some text", {})
      }.should raise_error(Resourceful::MissingContentType)
    end
    
    it "should allow the entity-body to be nil" do
      lambda {
        Resourceful.put('http://localhost:42682/', nil, {})
      }.should_not raise_error(ArgumentError)
    end
  end

  describe ".delete()" do

    it "should be performable on a resource and return a response" do
      response = Resourceful.delete('http://localhost:42682/')
      response.should be_kind_of(Resourceful::Response)
    end

  end
end

Version data entries

26 entries across 26 versions & 3 rubygems

Version Path
abiquo-etk-0.6.4 vendor/resourceful-1.0.1/spec/acceptance/resourceful_spec.rb
abiquo-etk-0.6.3 vendor/resourceful-1.0.1/spec/acceptance/resourceful_spec.rb
abiquo-etk-0.6.2 vendor/resourceful-1.0.1/spec/acceptance/resourceful_spec.rb
abiquo-etk-0.6.1 vendor/resourceful-1.0.1/spec/acceptance/resourceful_spec.rb
abiquo-etk-0.6.0 vendor/resourceful-1.0.1/spec/acceptance/resourceful_spec.rb
abiquo-etk-0.5.9 vendor/resourceful-1.0.1/spec/acceptance/resourceful_spec.rb
abiquo-etk-0.5.8 vendor/resourceful-1.0.1/spec/acceptance/resourceful_spec.rb
abiquo-etk-0.5.3 vendor/resourceful-1.0.1/spec/acceptance/resourceful_spec.rb
abiquo-etk-0.4.42 vendor/resourceful-1.0.1/spec/acceptance/resourceful_spec.rb
abiquo-etk-0.4.33 vendor/resourceful-1.0.1/spec/acceptance/resourceful_spec.rb
abiquo-etk-0.4.32 vendor/resourceful-1.0.1/spec/acceptance/resourceful_spec.rb
abiquo-etk-0.4.29 vendor/resourceful-1.0.1/spec/acceptance/resourceful_spec.rb
abiquo-etk-0.4.25 vendor/resourceful-1.0.1/spec/acceptance/resourceful_spec.rb
abiquo-etk-0.4.24 vendor/resourceful-1.0.1/spec/acceptance/resourceful_spec.rb
abiquo-etk-0.4.23 vendor/resourceful-1.0.1/spec/acceptance/resourceful_spec.rb
abiquo-etk-0.4.22 vendor/resourceful-1.0.1/spec/acceptance/resourceful_spec.rb
abiquo-etk-0.4.20 vendor/resourceful-1.0.1/spec/acceptance/resourceful_spec.rb
abiquo-etk-0.4.19 vendor/resourceful-1.0.1/spec/acceptance/resourceful_spec.rb
abiquo-etk-0.4.18 vendor/resourceful-1.0.1/spec/acceptance/resourceful_spec.rb
abiquo-etk-0.4.17 vendor/resourceful-1.0.1/spec/acceptance/resourceful_spec.rb