Sha256: fdfefb9a2ceaee5908990204a9ccca92578d61c1b4afd5e52deccd688ede0022
Contents?: true
Size: 1.08 KB
Versions: 2
Compression:
Stored size: 1.08 KB
Contents
#!/usr/local/bin/ruby $:.push "#{File.dirname(__FILE__)}/../lib" require 'test/unit' require 'protobuf/descriptor/descriptor_builder' require 'protobuf/descriptor/descriptor_proto' class DescriptorTest < Test::Unit::TestCase def test_unbuild tutorial_proto = Google::Protobuf::FileDescriptorProto.new tutorial_proto.parse_from_file 'person.bin' Protobuf::Descriptor::DescriptorBuilder.build tutorial_proto assert_nothing_raised {Tutorial::Person} assert_nothing_raised {Tutorial::Person.new} assert_equal ['email', 'id', 'name', 'phone'], Tutorial::Person.fields.map{|tag, field| field.name}.sort assert_nothing_raised {Tutorial::Person::PhoneNumber} assert_nothing_raised {Tutorial::Person::PhoneNumber.new} assert_equal ['number', 'type'], Tutorial::Person::PhoneNumber.fields.map{|tag, field| field.name}.sort assert_nothing_raised {Tutorial::Person::PhoneType} assert_equal 0, Tutorial::Person::PhoneType::MOBILE assert_equal 1, Tutorial::Person::PhoneType::HOME assert_equal 2, Tutorial::Person::PhoneType::WORK end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
ruby_protobuf-0.2.0 | test/check_unbuild.rb |
ruby_protobuf-0.3.0 | test/check_unbuild.rb |