Sha256: 95a9f9a7a0e0f1614a0b4010ebc1e1563377250a6d97d1e0169322f8bd41d373

Contents?: true

Size: 588 Bytes

Versions: 14

Compression:

Stored size: 588 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', '3' => '4'}).should == [['1', '2'], ['3', '4']]
  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

14 entries across 14 versions & 1 rubygems

Version Path
toystore-0.9.0 spec/toy/extensions/array_spec.rb
toystore-0.8.3 spec/toy/extensions/array_spec.rb
toystore-0.8.2 spec/toy/extensions/array_spec.rb
toystore-0.8.1 spec/toy/extensions/array_spec.rb
toystore-0.8.0 spec/toy/extensions/array_spec.rb
toystore-0.7.0 spec/toy/extensions/array_spec.rb
toystore-0.6.6 spec/toy/extensions/array_spec.rb
toystore-0.6.5 spec/toy/extensions/array_spec.rb
toystore-0.6.4 spec/toy/extensions/array_spec.rb
toystore-0.6.3 spec/toy/extensions/array_spec.rb
toystore-0.6.2 spec/toy/extensions/array_spec.rb
toystore-0.6.1 spec/toy/extensions/array_spec.rb
toystore-0.6 spec/toy/extensions/array_spec.rb
toystore-0.5 spec/toy/extensions/array_spec.rb