• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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
6require 'generated_code_editions_pb'
7require 'generated_code_pb'
8require 'test_import_pb'
9require 'test_ruby_package_pb'
10require 'test/unit'
11
12class GeneratedCodeTest < Test::Unit::TestCase
13  def test_generated_msg
14    # just test that we can instantiate the message. The purpose of this test
15    # is to ensure that the output of the code generator is valid Ruby and
16    # successfully creates message definitions and classes, not to test every
17    # aspect of the extension (basic.rb is for that).
18    A::B::C::TestMessage.new
19    A::B::C::TestMessage::NestedMessage.new
20    A::B::C::TestLowercaseNested::Lowercase.new
21    FooBar::TestImportedMessage.new
22    A::B::TestRubyPackageMessage.new
23    A::B::Editions::TestMessage.new
24    A::B::Editions::TestMessage::NestedMessage.new
25  end
26end
27