Commit 6d92233e authored by Josh Haberman's avatar Josh Haberman

Added unit test for PascalCasing package names in Ruby.

parent 6cab568e
......@@ -80,10 +80,15 @@ end
# Proto for tests.
genproto_output << "tests/generated_code.rb"
genproto_output << "tests/test_import.rb"
file "tests/generated_code.rb" => "tests/generated_code.proto" do |file_task|
sh "../src/protoc --ruby_out=. tests/generated_code.proto"
end
file "tests/test_import.rb" => "tests/test_import.proto" do |file_task|
sh "../src/protoc --ruby_out=. tests/test_import.proto"
end
task :genproto => genproto_output
task :clean do
......
syntax = "proto3";
package A.B.C;
package a.b.c;
message TestMessage {
int32 optional_int32 = 1;
......
......@@ -4,6 +4,7 @@
$LOAD_PATH.unshift(File.expand_path(File.dirname(__FILE__)))
require 'generated_code_pb'
require 'test_import_pb'
require 'test/unit'
class GeneratedCodeTest < Test::Unit::TestCase
......@@ -13,5 +14,6 @@ class GeneratedCodeTest < Test::Unit::TestCase
# successfully creates message definitions and classes, not to test every
# aspect of the extension (basic.rb is for that).
m = A::B::C::TestMessage.new()
m2 = FooBar::TestImportedMessage.new()
end
end
syntax = "proto3";
package foo_bar;
message TestImportedMessage {}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment