Sha256: cc8771f3342be54b8c9b74ccf87c23cf1f5c72f1224764f37e1662b3208a74a3

Contents?: true

Size: 565 Bytes

Versions: 10

Compression:

Stored size: 565 Bytes

Contents

require 'helper'

describe "Array.to_store" do
  it "should convert value to_a" do
    Array.to_store([1, 2, 3, 4]).should == [1, 2, 3, 4]
    Array.to_store('1').should == ['1']
    Array.to_store({'1' => '2'}).should == [['1', '2']]
  end
end

describe "Array.from_store" do
  it "should be array if array" do
    Array.from_store([1, 2]).should == [1, 2]
  end

  it "should be empty array if nil" do
    Array.from_store(nil).should == []
  end
end

describe "Array.store_default" do
  it "returns emtpy array" do
    Array.store_default.should == []
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
toystore-0.13.2 spec/toy/extensions/array_spec.rb
toystore-0.13.1 spec/toy/extensions/array_spec.rb
toystore-0.13.0 spec/toy/extensions/array_spec.rb
toystore-0.12.0 spec/toy/extensions/array_spec.rb
toystore-0.11.0 spec/toy/extensions/array_spec.rb
toystore-0.10.4 spec/toy/extensions/array_spec.rb
toystore-0.10.3 spec/toy/extensions/array_spec.rb
toystore-0.10.2 spec/toy/extensions/array_spec.rb
toystore-0.10.1 spec/toy/extensions/array_spec.rb
toystore-0.10.0 spec/toy/extensions/array_spec.rb