Skip to content

Commit

Permalink
Fix the path to escript in 006-multiup.t.
Browse files Browse the repository at this point in the history
Signed-off-by: François de Metz <fdemetz@af83.com>
  • Loading branch information
francois2metz committed Oct 6, 2011
1 parent 4e1d0c5 commit e3bfd23
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions t/006-multiup.t
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
#!/usr/local/bin/escript
#!/usr/bin/env escript
%% -*- erlang -*-
%%! -pa ebin -sasl errlog_type error -boot start_sasl -noshell -config priv/example

main(_) ->
etap:plan(unknown),
error_logger:tty(false),
etap_application:start_ok(emongo, "application 'emongo' started ok"),

emongo:delete(test1, "sushi"),
etap:is(emongo:find_all(test1, "sushi"), [], "sushi collection is empty"),

[emongo:insert(test1, "sushi", [{<<"rolls">>, I}]) || I <- lists:seq(1, 50)],

(fun() ->
emongo:update(test1, "sushi", [{<<"rolls">>, [{gt, 45}]}], [{<<"$set">>, [{<<"rolls">>, 100}]}], false, true),
Docs = emongo:find_all(test1, "sushi", [{<<"rolls">>, 100}], []),
etap:is(length(Docs), 5, "correct number of results after multiupdate"),
etap:is([I || [_, {_, I}] <- Docs], [100,100,100,100,100], "correct results after multiupdate"),
ok
emongo:update(test1, "sushi", [{<<"rolls">>, [{gt, 45}]}], [{<<"$set">>, [{<<"rolls">>, 100}]}], false, true),
Docs = emongo:find_all(test1, "sushi", [{<<"rolls">>, 100}], []),
etap:is(length(Docs), 5, "correct number of results after multiupdate"),
etap:is([I || [_, {_, I}] <- Docs], [100,100,100,100,100], "correct results after multiupdate"),
ok
end)(),

etap:end_tests().

0 comments on commit e3bfd23

Please sign in to comment.