Sha256: ca31db88cfe8adbc71e92d6037d50534a60b727bf58b74c59f071cb8d15b0033

Contents?: true

Size: 563 Bytes

Versions: 24

Compression:

Stored size: 563 Bytes

Contents

require 'helper'

describe "Set.to_store" do
  it "should convert value to_a" do
    Set.to_store(Set.new([1,2,3])).should == [1,2,3]
  end

  it "should convert to empty array if nil" do
    Set.to_store(nil).should == []
  end
end

describe "Set.from_store" do
  it "should be a set if array" do
    Set.from_store([1,2,3]).should == Set.new([1,2,3])
  end

  it "should be empty set if nil" do
    Set.from_store(nil).should == Set.new([])
  end
end

describe "Set.store_default" do
  it "returns empty set" do
    Set.store_default.should == Set.new
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
toystore-0.13.2 spec/toy/extensions/set_spec.rb
toystore-0.13.1 spec/toy/extensions/set_spec.rb
toystore-0.13.0 spec/toy/extensions/set_spec.rb
toystore-0.12.0 spec/toy/extensions/set_spec.rb
toystore-0.11.0 spec/toy/extensions/set_spec.rb
toystore-0.10.4 spec/toy/extensions/set_spec.rb
toystore-0.10.3 spec/toy/extensions/set_spec.rb
toystore-0.10.2 spec/toy/extensions/set_spec.rb
toystore-0.10.1 spec/toy/extensions/set_spec.rb
toystore-0.10.0 spec/toy/extensions/set_spec.rb
toystore-0.9.0 spec/toy/extensions/set_spec.rb
toystore-0.8.3 spec/toy/extensions/set_spec.rb
toystore-0.8.2 spec/toy/extensions/set_spec.rb
toystore-0.8.1 spec/toy/extensions/set_spec.rb
toystore-0.8.0 spec/toy/extensions/set_spec.rb
toystore-0.7.0 spec/toy/extensions/set_spec.rb
toystore-0.6.6 spec/toy/extensions/set_spec.rb
toystore-0.6.5 spec/toy/extensions/set_spec.rb
toystore-0.6.4 spec/toy/extensions/set_spec.rb
toystore-0.6.3 spec/toy/extensions/set_spec.rb