Partition#delete test added

This commit is contained in:
Luka Vandervelden 2020-02-11 19:45:54 +01:00
parent 10b0061133
commit 74aff338ff

View File

@ -308,6 +308,24 @@ describe "DODB::DataBase" do
}.should be_true }.should be_true
end end
end end
it "removes select elements from partitions" do
db = DODB::SpecDataBase.new
db_ships_by_class = db.new_partition "class", &.klass
Ship.all_ships.each do |ship|
db << ship
end
db_ships_by_class.delete "Mutsuki", &.name.==("Kisaragi")
Ship.all_ships.map(&.klass).uniq.each do |klass|
partition = db_ships_by_class.get klass
partition.any?(&.name.==("Kisaragi")).should be_false
end
end
end end
describe "tags" do describe "tags" do