generated_code_test.rb 804 B

1234567891011121314151617181920212223
  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_ruby_package_pb'
  7. require 'test/unit'
  8. class GeneratedCodeTest < 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::C::TestMessage.new
  15. A::B::C::TestMessage::NestedMessage.new
  16. A::B::C::TestLowercaseNested::Lowercase.new
  17. FooBar::TestImportedMessage.new
  18. A::B::TestRubyPackageMessage.new
  19. end
  20. end