generated_code_proto2_test.rb 760 B

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