Writes the given tradition to the database, returning its ID.
+=head2 delete( $tradition )
+
+Deletes the given tradition object from the database.
+WARNING!! Garbage collection does not yet work. Use this sparingly.
+
=begin testing
use TryCatch;
is( scalar $f->tradition_ids, 1, "Object is deleted from index" );
}
-SKIP: {
- skip 'Have yet to figure out garbage collection', 1;
+{
my $g = Text::Tradition::Directory->new( 'dsn' => $dsn );
my $scope = $g->new_scope;
is( scalar $g->tradition_ids, 1, "Now one object in new directory index" );
}
};
-# If a tradition is deleted, remove it from the index.
-after delete => sub {
- my $self = shift;
- my $gc = KiokuDB::GC::Naive->new( backend => $self->directory->backend );
- $self->directory->backend->delete( $gc->garbage->members );
-};
+# TODO Garbage collection doesn't work. Suck it up and live with the
+# inflated DB.
+# after delete => sub {
+# my $self = shift;
+# my $gc = KiokuDB::GC::Naive->new( backend => $self->directory->backend );
+# $self->directory->backend->delete( $gc->garbage->members );
+# };
sub save {
my $self = shift;
is( scalar $f->tradition_ids, 1, "Object is deleted from index" );
}
-SKIP: {
- skip 'Have yet to figure out garbage collection', 1;
+{
my $g = Text::Tradition::Directory->new( 'dsn' => $dsn );
my $scope = $g->new_scope;
is( scalar $g->tradition_ids, 1, "Now one object in new directory index" );