generated_code_test.rb 657 B

12345678910111213141516171819
  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_pb'
  5. require 'test_import_pb'
  6. require 'test/unit'
  7. class GeneratedCodeTest < Test::Unit::TestCase
  8. def test_generated_msg
  9. # just test that we can instantiate the message. The purpose of this test
  10. # is to ensure that the output of the code generator is valid Ruby and
  11. # successfully creates message definitions and classes, not to test every
  12. # aspect of the extension (basic.rb is for that).
  13. m = A::B::C::TestMessage.new()
  14. m2 = FooBar::TestImportedMessage.new()
  15. end
  16. end