Sha256: 1ef2d7c143f7af509c1c30900a1f08358cfc56d0713777ad037d3929faad3a4d
Contents?: true
Size: 835 Bytes
Versions: 3
Compression:
Stored size: 835 Bytes
Contents
require "spec_helper" require "hamster/experimental/mutable_set" describe Hamster::MutableSet do let(:mutable) { Hamster::MutableSet[*values] } describe "#delete" do let(:values) { %w[A B C] } let(:delete) { mutable.delete(value) } context "with an existing value" do let(:value) { "B" } it "returns self" do expect(delete).to eq(mutable) end it "modifies the set to remove the value" do delete expect(mutable).to eq(Hamster::MutableSet["A", "C"]) end end context "with a non-existing value" do let(:value) { "D" } it "returns self" do expect(delete).to eq(mutable) end it "preserves the original values" do delete expect(mutable).to eq(Hamster::MutableSet["A", "B", "C"]) end end end end
Version data entries
3 entries across 3 versions & 2 rubygems