Sha256: c268293afa39069ea77dddb2fccc7e080391380417611a35ab94ce1551c16544
Contents?: true
Size: 1.2 KB
Versions: 3
Compression:
Stored size: 1.2 KB
Contents
# encoding: UTF-8 require File.dirname(__FILE__) + '/test_helper' class ProtopuffsTest < Test::Unit::TestCase context ".proto_load_path accessors" do setup { Protopuffs.proto_load_path = [] } should "have an accessor for an array of load paths for .proto files" do Protopuffs.proto_load_path << "proto_files" << "other_proto_files" assert_equal ["proto_files", "other_proto_files"], Protopuffs.proto_load_path end should "have a mutator for directly assigning the load paths" do Protopuffs.proto_load_path = ["my_proto_files"] assert_equal ["my_proto_files"], Protopuffs.proto_load_path end end should "have a ParseError class" do Protopuffs::ParseError end context ".load_message_classes when a descriptor is in the load path with a Person message" do setup { Protopuffs.proto_load_path = ["#{File.dirname(__FILE__)}/fixtures/proto"] } should "create a Person message class with correct accessors" do Protopuffs.load_message_classes p = Protopuffs::Message::Person.new p.name = "Chris" p.id = 42 p.email = "chris@kampers.net" assert_equal ["Chris", 42, "chris@kampers.net"], [p.name, p.id, p.email] end end end
Version data entries
3 entries across 3 versions & 2 rubygems
Version | Path |
---|---|
chrisk-protopuffs-0.2.1 | test/protopuffs_test.rb |
chrisk-protopuffs-0.3.0 | test/protopuffs_test.rb |
protopuffs-0.3.0 | test/protopuffs_test.rb |