test/auth0_test.rb in rufus-verbs-0.10 vs test/auth0_test.rb in rufus-verbs-1.0.0
- old
+ new
@@ -5,42 +5,39 @@
# jmettraux@gmail.com
#
# Sun Jan 13 12:33:03 JST 2008
#
-require 'test/unit'
-require 'testbase'
+require File.dirname(__FILE__) + '/base.rb'
-require 'rufus/verbs'
-
class Auth0Test < Test::Unit::TestCase
- include TestBaseMixin
+ include TestBaseMixin
- include Rufus::Verbs
+ include Rufus::Verbs
- #
- # Using an items server with the authentication on.
- #
- def setup
+ #
+ # Using an items server with the authentication on.
+ #
+ def setup
- @server = ItemServer.new :auth => :basic
- @server.start
- end
+ @server = ItemServer.new :auth => :basic
+ @server.start
+ end
- def test_0
+ def test_0
- #res = get :uri => "http://localhost:7777/items"
- #assert_equal 200, res.code.to_i
- #assert_equal "{}", res.body.strip
- expect 401, nil, get(:uri => "http://localhost:7777/items")
+ #res = get :uri => "http://localhost:7777/items"
+ #assert_equal 200, res.code.to_i
+ #assert_equal "{}", res.body.strip
+ expect 401, nil, get(:uri => "http://localhost:7777/items")
- expect 401, nil, get(
- :uri => "http://localhost:7777/items",
- :http_basic_authentication => [ "toto", "wrong" ])
+ expect 401, nil, get(
+ :uri => "http://localhost:7777/items",
+ :http_basic_authentication => [ "toto", "wrong" ])
- expect 200, {}, get(
- :uri => "http://localhost:7777/items?a",
- :http_basic_authentication => [ "toto", "toto" ])
- end
+ expect 200, {}, get(
+ :uri => "http://localhost:7777/items?a",
+ :http_basic_authentication => [ "toto", "toto" ])
+ end
end