Sha256: e761ccbafe164adcc646f7a1e30850803df4ac2b6116449d2dbce2edce4bef34

Contents?: true

Size: 846 Bytes

Versions: 3

Compression:

Stored size: 846 Bytes

Contents

# coding: utf-8

require 'test_helper'

class Thinreports::Core::Shape::List::TestStore < Minitest::Test
  include Thinreports::TestHelper
  
  List = Thinreports::Core::Shape::List
  
  def test_new
    klass = List::Store.new(foo: 'foo', hoge: 0)
    
    assert_instance_of ::Class, klass
    
    st1 = klass.new
    st2 = klass.new
    
    refute_same st1.foo, st2.foo
    # Fixnum is immutable
    assert_same st1.hoge, st2.hoge
  end
  
  def test_init
    store = List::Store.init(foo: 0, hoge: 'hoge')
    
    assert_respond_to store, :foo
    assert_respond_to store, :hoge
    
    assert_equal store.foo, 0
    assert_equal store.hoge, 'hoge'
  end
  
  def test_copy
    store = List::Store.init(foo: Time.now)
    
    copied = store.copy
    
    assert_equal store.foo, copied.foo
    refute_same store.foo, copied.foo
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
thinreports-0.8.2 test/unit/core/shape/list/test_store.rb
thinreports-0.8.1 test/unit/core/shape/list/test_store.rb
thinreports-0.8.0 test/unit/core/shape/list/test_store.rb