test/hyperclient_test.rb in hyperclient-0.0.7 vs test/hyperclient_test.rb in hyperclient-0.0.8
- old
+ new
@@ -8,43 +8,43 @@
end
end
describe 'entry point' do
it 'sets the entry point for Hyperclient::Resource' do
- api.entry_point 'http://my.api.org'
+ api.entry_point {'http://my.api.org'}
Hyperclient::Resource.new('/').url.must_include 'http://my.api.org'
end
end
describe 'entry' do
before do
- api.entry_point 'http://my.api.org'
+ api.entry_point {'http://my.api.org'}
end
it 'initializes a Resource at the entry point' do
api.new.entry.url.must_equal 'http://my.api.org'
end
it 'also works with entry points that are not in the root' do
- api.entry_point 'http://my.api.org/api'
+ api.entry_point {'http://my.api.org/api'}
api.new.entry.url.must_equal 'http://my.api.org/api'
end
it 'sets the Resource name' do
api.new.name.must_equal 'Entry point'
end
end
describe 'auth' do
it 'sets authentication type' do
- api.auth(:digest, nil, nil)
+ api.auth{ {type: :digest, user: nil, password: nil} }
api.http_options[:http][:auth][:type].must_equal :digest
end
it 'sets the authentication credentials' do
- api.auth(:digest, 'user', 'secret')
+ api.auth{ {type: :digest, user: 'user', password: 'secret'} }
api.http_options[:http][:auth][:credentials].must_include 'user'
api.http_options[:http][:auth][:credentials].must_include 'secret'
end
end
\ No newline at end of file