Sha256: b80acbb73996f5220be08b4f4a405087b4a793c6b8e559f1bfc11d6bda5b9f5e

Contents?: true

Size: 823 Bytes

Versions: 7

Compression:

Stored size: 823 Bytes

Contents

require 'spec_helper'

require 'hamster/set'

describe Hamster::Set do

  describe "#delete" do

    before do
      @original = Hamster.set("A", "B", "C")
    end

    describe "with an existing value" do

      before do
        @result = @original.delete("B")
      end

      it "preserves the original" do
        @original.should == Hamster.set("A", "B", "C")
      end

      it "returns a copy with the remaining of values" do
        @result.should == Hamster.set("A", "C")
      end

    end

    describe "with a non-existing value" do

      before do
        @result = @original.delete("D")
      end

      it "preserves the original values" do
        @original.should == Hamster.set("A", "B", "C")
      end

      it "returns self" do
        @result.should equal(@original)
      end

    end

  end

end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
hamster-0.4.3 spec/hamster/set/delete_spec.rb
hamster-0.4.2 spec/hamster/set/delete_spec.rb
hamster-0.4.0 spec/hamster/set/delete_spec.rb
hamster-0.3.10 spec/hamster/set/delete_spec.rb
hamster-0.3.9 spec/hamster/set/delete_spec.rb
hamster-0.3.8 spec/hamster/set/delete_spec.rb
hamster-0.3.7 spec/hamster/set/delete_spec.rb