blob: 431d681bb36e26d5c6878fe7e98f125564bb7ea2 [file] [log] [blame]
Brian Silverman9c614bc2016-02-15 20:20:02 -05001#!/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
Austin Schuh40c16522018-10-28 20:27:54 -07006require 'generated_code_pb'
7require 'test_import_pb'
8require 'test_ruby_package_pb'
Brian Silverman9c614bc2016-02-15 20:20:02 -05009require '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 m = A::B::C::TestMessage.new()
Austin Schuh40c16522018-10-28 20:27:54 -070018 m2 = FooBar::TestImportedMessage.new()
19 m3 = A::B::TestRubyPackageMessage.new()
Brian Silverman9c614bc2016-02-15 20:20:02 -050020 end
21end