Skip to content

Commit

Permalink
fixed http default error message
Browse files Browse the repository at this point in the history
  • Loading branch information
jmettraux committed Jan 16, 2010
1 parent 9428ea3 commit 0cbe211
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
3 changes: 1 addition & 2 deletions src/cloche_http.erl
Expand Up @@ -64,8 +64,7 @@ handle('DELETE', [ Type ], Req, Cloche) ->
%

handle(M, P, Req, _) ->
% TODO : use something like io:format
error(Req, "not implemented : " ++ M ++ " " ++ P).
error(Req, io_lib:format("not implementend : ~p ~p", [ M, P ])).

%
% helpers
Expand Down
18 changes: 13 additions & 5 deletions test/ct_2_delete.rb
Expand Up @@ -19,6 +19,10 @@ class DeleteTest < Test::Unit::TestCase

def setup
@h = Rufus::Jig::Http.new('127.0.0.1', 9000)
@h.put(
'/person/jami',
{ '_id' => 'jami', 'type' => 'person', 'eyes' => 'blue' },
{ :content_type => :json })
end
def teardown
@h.delete('/person')
Expand All @@ -27,14 +31,18 @@ def teardown

def test_delete_type

@h.put(
'/person/jami',
{ '_id' => 'jami', 'type' => 'person', 'eyes' => 'blue' },
{ :content_type => :json })

@h.delete('/person')

assert_equal(false, File.exist?('htest/person/mi/jami.json'))
end

def test_delete

assert_equal(true, File.exist?('htest/person/mi/jami.json'))

@h.delete('/person/jami')

assert_equal(false, File.exist?('htest/person/mi/jami.json'))
end
end

0 comments on commit 0cbe211

Please sign in to comment.