I stick it in vendor
This commit is contained in:
parent
32b8090ddb
commit
2f7a5210c4
7 changed files with 0 additions and 0 deletions
31
vendor/rest-client/spec/resource_spec.rb
vendored
Normal file
31
vendor/rest-client/spec/resource_spec.rb
vendored
Normal file
|
@ -0,0 +1,31 @@
|
|||
require File.dirname(__FILE__) + '/base'
|
||||
|
||||
describe RestClient::Resource do
|
||||
before do
|
||||
@resource = RestClient::Resource.new('http://some/resource', 'jane', 'mypass')
|
||||
end
|
||||
|
||||
it "GET" do
|
||||
RestClient::Request.should_receive(:execute).with(:method => :get, :url => 'http://some/resource', :headers => {}, :user => 'jane', :password => 'mypass')
|
||||
@resource.get
|
||||
end
|
||||
|
||||
it "POST" do
|
||||
RestClient::Request.should_receive(:execute).with(:method => :post, :url => 'http://some/resource', :payload => 'abc', :headers => { :content_type => 'image/jpg' }, :user => 'jane', :password => 'mypass')
|
||||
@resource.post 'abc', :content_type => 'image/jpg'
|
||||
end
|
||||
|
||||
it "PUT" do
|
||||
RestClient::Request.should_receive(:execute).with(:method => :put, :url => 'http://some/resource', :payload => 'abc', :headers => { :content_type => 'image/jpg' }, :user => 'jane', :password => 'mypass')
|
||||
@resource.put 'abc', :content_type => 'image/jpg'
|
||||
end
|
||||
|
||||
it "DELETE" do
|
||||
RestClient::Request.should_receive(:execute).with(:method => :delete, :url => 'http://some/resource', :headers => {}, :user => 'jane', :password => 'mypass')
|
||||
@resource.delete
|
||||
end
|
||||
|
||||
it "can instantiate with no user/password" do
|
||||
@resource = RestClient::Resource.new('http://some/resource')
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue