Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
P
protobuf
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
protobuf
Commits
6d92233e
Commit
6d92233e
authored
Jul 25, 2016
by
Josh Haberman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added unit test for PascalCasing package names in Ruby.
parent
6cab568e
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
13 additions
and
1 deletion
+13
-1
Rakefile
ruby/Rakefile
+5
-0
generated_code.proto
ruby/tests/generated_code.proto
+1
-1
generated_code_test.rb
ruby/tests/generated_code_test.rb
+2
-0
test_import.proto
ruby/tests/test_import.proto
+5
-0
No files found.
ruby/Rakefile
View file @
6d92233e
...
...
@@ -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
...
...
ruby/tests/generated_code.proto
View file @
6d92233e
syntax
=
"proto3"
;
package
A
.
B.C
;
package
a
.
b.c
;
message
TestMessage
{
int32
optional_int32
=
1
;
...
...
ruby/tests/generated_code_test.rb
View file @
6d92233e
...
...
@@ -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
ruby/tests/test_import.proto
0 → 100644
View file @
6d92233e
syntax
=
"proto3"
;
package
foo_bar
;
message
TestImportedMessage
{}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment