Sha256: 5ba5b0a2674cdf82fbe7bfe26a5829bb42067614f05a340dd6b0519a0d236196

Contents?: true

Size: 586 Bytes

Versions: 2

Compression:

Stored size: 586 Bytes

Contents

require "spec_helper"

describe Rico::Set do
  before :each do
    RiakHelpers.reset!
  end

  describe "#add" do
    it "dedupes and retains order in instance" do
      a = Rico::Set.new RiakHelpers.bucket, "set_add_1"
      a.add [3, 4, 6, 8, 1, 2, 3, 4, 7]
      a.members.should eql [3, 4, 6, 8, 1, 2, 7]
    end

    it "dedupes and sort is retained on read" do
      a = Rico::Set.new RiakHelpers.bucket, "set_add_2"
      a.add [3, 4, 6, 8, 1, 2, 3, 4, 7]
      b = Rico::Set.new RiakHelpers.bucket, "set_add_2"
      b.members.should eql [3, 4, 6, 8, 1, 2, 7]
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
rico-0.5.0 spec/set_spec.rb
rico-0.4.0 spec/set_spec.rb