ejdbclose(ejdb);
}
-void EJDB_drop_collection(VALUE self, VALUE collName, VALUE prune) {
+void EJDB_drop_collection(int argc, VALUE* argv, VALUE self) {
+ VALUE collName;
+ VALUE prune;
+
+ rb_scan_args(argc, argv, "11", &collName, &prune);
+
SafeStringValue(collName);
EJDB* ejdb = getEJDB(self);
rb_define_method(ejdbClass, "update", RUBY_METHOD_FUNC(EJDB_update), -1);
rb_define_method(ejdbClass, "remove", RUBY_METHOD_FUNC(EJDB_remove), 2);
- rb_define_method(ejdbClass, "drop_collection", RUBY_METHOD_FUNC(EJDB_drop_collection), 2);
+ rb_define_method(ejdbClass, "drop_collection", RUBY_METHOD_FUNC(EJDB_drop_collection), -1);
rb_define_method(ejdbClass, "ensure_collection", RUBY_METHOD_FUNC(EJDB_ensure_collection), -1);
rb_define_method(ejdbClass, "drop_indexes", RUBY_METHOD_FUNC(EJDB_drop_indexes), 2);
assert_not_nil $jb
assert $jb.is_open?
$jb.sync
+ puts "test_ejdbc_sync has passed successfull"
end
+
+ def test_ejdbd_remove_colls
+ assert_not_nil $jb
+ assert $jb.is_open?
+
+ $jb.drop_collection("birds")
+
+ results = $jb.find("birds", {})
+ assert_equal(0, results.count)
+ assert_nil results.find { true }
+
+ puts "test_ejdbd_remove_colls has passed successfull"
+ end
+
end