Sha256: d3512618f619957487012f4db4a3927deb40bc1bd013cd2321838891a1d9ce0c

Contents?: true

Size: 617 Bytes

Versions: 9

Compression:

Stored size: 617 Bytes

Contents

require 'test/unit'
require 'funkr/types/simple_record'

class TestSimpleRecords < Test::Unit::TestCase

  def test_simple_records
    r = Funkr::Types::SimpleRecord.new(name: "Paul", age: 27, city: "Rennes")
    name, age, city = r
    assert_equal("Paul", name)
    assert_equal(27, age)
    assert_equal("Rennes", city)
    name, age, city = r.with(age: 28, city: "Trouville")
    assert_equal("Paul", name)
    assert_equal(28, age)
    assert_equal("Trouville", city)

    r.name = "Paul R"
    assert_equal("Paul R", r.name)

    r.update!(name: "Paul")
    n, _x, _y = r
    assert_equal("Paul", n)
  end

end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
funkr-0.0.40 test/test_simple_records.rb
funkr-0.0.30 test/test_simple_records.rb
funkr-0.0.28 test/test_simple_records.rb
funkr-0.0.27 test/test_simple_records.rb
funkr-0.0.26 test/test_simple_records.rb
funkr-0.0.25 test/test_simple_records.rb
funkr-0.0.24 test/test_simple_records.rb
funkr-0.0.23 test/test_simple_records.rb
funkr-0.0.22 test/test_simple_records.rb