test/block_test.rb in rufus-verbs-0.10 vs test/block_test.rb in rufus-verbs-1.0.0

- old
+ new

@@ -5,45 +5,43 @@ # jmettraux@gmail.com # # Sun Jan 13 20:02:25 JST 2008 # -require 'test/unit' -require 'testbase' -require 'rufus/verbs' +require File.dirname(__FILE__) + '/base.rb' class BlockTest < Test::Unit::TestCase - include TestBaseMixin + include TestBaseMixin - include Rufus::Verbs + include Rufus::Verbs - def test_0 + def test_0 - res = post :uri => "http://localhost:7777/items/0" do - "Fedor" + - "Fedorovitch" - end - assert_equal 201, res.code.to_i - assert_equal "http://localhost:7777/items/0", res['Location'] + res = post :uri => "http://localhost:7777/items/0" do + "Fedor" + + "Fedorovitch" + end + assert_equal 201, res.code.to_i + assert_equal "http://localhost:7777/items/0", res['Location'] - expect( - 200, - { 0 => "FedorFedorovitch" }, - get(:uri => "http://localhost:7777/things")) + expect( + 200, + { 0 => "FedorFedorovitch" }, + get(:uri => "http://localhost:7777/things")) - res = post :uri => "http://localhost:7777/items/1" do |req| - # do whatever with the request [headers] - "John" - end - assert_equal 201, res.code.to_i - assert_equal "http://localhost:7777/items/1", res['Location'] - - expect( - 200, - { 0 => "FedorFedorovitch", 1 => "John" }, - get(:uri => "http://localhost:7777/things")) + res = post :uri => "http://localhost:7777/items/1" do |req| + # do whatever with the request [headers] + "John" end + assert_equal 201, res.code.to_i + assert_equal "http://localhost:7777/items/1", res['Location'] + + expect( + 200, + { 0 => "FedorFedorovitch", 1 => "John" }, + get(:uri => "http://localhost:7777/things")) + end end