Skip to content

Instantly share code, notes, and snippets.

@samhendley
Created May 20, 2010 16:12
Show Gist options
  • Save samhendley/407742 to your computer and use it in GitHub Desktop.
Save samhendley/407742 to your computer and use it in GitHub Desktop.
Loaded suite C:/code/scada/ruby-protobuf/test/test_rerequire
Started
E.
Finished in 0.015625 seconds.
1) Error:
test_re_require(RerequireTest):
Protobuf::TagCollisionError: {Field number 1 has already been used in "Tutorial::Person" by field "name".
C:\code\scada\ruby-protobuf\lib/protobuf/message/message.rb:56:in `define_field'
C:\code\scada\ruby-protobuf\lib/protobuf/message/message.rb:39:in `required'
./test/proto/addressbook.pb.rb:45
C:/code/scada/ruby-protobuf/test/test_rerequire.rb:9:in `require'
C:/code/scada/ruby-protobuf/test/test_rerequire.rb:9:in `test_re_require'
1 tests, 0 assertions, 0 failures, 1 errors
require 'test/unit'
require 'protobuf/message/message'
require 'protobuf/message/enum'
class RerequireTest < Test::Unit::TestCase
def test_re_require
require 'test/proto/addressbook.pb'
$:.push('test/proto')
# this causes a re-require since the ruby 'require' lookup doesn't look at
# what file is actually getting loaded, only the string its asked for by
require 'addressbook.pb'
end
def test_re_require2
require 'test/proto/addressbook.pb'
# though it is smart enough to trim off the extra .rb in this case
require 'test/proto/addressbook.pb.rb'
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment