Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 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 | |
Austin Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 6 | require 'generated_code_pb' |
| 7 | require 'test_import_pb' |
| 8 | require 'test_ruby_package_pb' |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 9 | require 'test/unit' |
| 10 | |
| 11 | class 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 Schuh | 40c1652 | 2018-10-28 20:27:54 -0700 | [diff] [blame^] | 18 | m2 = FooBar::TestImportedMessage.new() |
| 19 | m3 = A::B::TestRubyPackageMessage.new() |
Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame] | 20 | end |
| 21 | end |