1#!/usr/bin/ruby 2 3# generated_code.rb is in the same directory as this test. 4$LOAD_PATH.unshift(File.expand_path(File.dirname(__FILE__))) 5 6require 'generated_code_pb' 7require 'test_import_pb' 8require 'test_ruby_package_pb' 9require 'test/unit' 10 11class GeneratedCodeTest < Test::Unit::TestCase 12 def test_generated_msg 13 # just test that we can instantiate the message. The purpose of this test 14 # is to ensure that the output of the code generator is valid Ruby and 15 # successfully creates message definitions and classes, not to test every 16 # aspect of the extension (basic.rb is for that). 17 A::B::C::TestMessage.new 18 A::B::C::TestMessage::NestedMessage.new 19 A::B::C::TestLowercaseNested::Lowercase.new 20 FooBar::TestImportedMessage.new 21 A::B::TestRubyPackageMessage.new 22 end 23end 24