Sha256: 5f2982666b379dc2f20ba9ab94426354fc61b8485d2000830d83a14f611b35f9

Contents?: true

Size: 507 Bytes

Versions: 2

Compression:

Stored size: 507 Bytes

Contents

require 'protobuf/message/message'
require 'test/addressbook'
require 'test/unit'

class MessageTest < Test::Unit::TestCase
  def test_bracketed_access
    person = Tutorial::Person.new
    name_tag = 1
    person[name_tag] = 'Ichiro'
    assert_equal 'Ichiro', person.name
    assert_equal 'Ichiro', person[name_tag]

    person[:id] = 100
    assert_equal 100, person.id
    person['id'] = 200
    assert_equal 200, person.id
    assert_equal 200, person[:id]
    assert_equal 200, person['id']
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
ruby_protobuf-0.2.0 test/test_message.rb
ruby_protobuf-0.3.0 test/test_message.rb