protobuf 2.2.5-java → 2.2.6-java
Sign up to get free protection for your applications and to get access to all the features.
data/lib/protobuf/enum.rb
CHANGED
data/lib/protobuf/enum_value.rb
CHANGED
data/lib/protobuf/rpc/client.rb
CHANGED
data/lib/protobuf/version.rb
CHANGED
@@ -12,4 +12,8 @@ describe Protobuf::EnumValue do
|
|
12
12
|
its(:inspect) { should eq('#<Protobuf::EnumValue Test::EnumTestType::ONE=1>') }
|
13
13
|
specify { subject.to_s(:name).should eq("ONE") }
|
14
14
|
|
15
|
+
it "can be used as the index to an array" do
|
16
|
+
array = [0, 1, 2, 3]
|
17
|
+
array[::Test::EnumTestType::ONE].should eq(1)
|
18
|
+
end
|
15
19
|
end
|
data/spec/spec_helper.rb
CHANGED
@@ -23,12 +23,14 @@ end
|
|
23
23
|
c.mock_with :rspec
|
24
24
|
|
25
25
|
c.before(:suite) do
|
26
|
-
unless
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
26
|
+
unless defined?(JRUBY_VERSION)
|
27
|
+
unless ENV['NO_COMPILE_TEST_PROTOS']
|
28
|
+
$stdout.puts 'Compiling test protos (use NO_COMPILE_TEST_PROTOS=1 to skip)'
|
29
|
+
proto_path = File.expand_path("../support/", __FILE__)
|
30
|
+
cmd = %Q{ rprotoc --proto_path=#{proto_path} --ruby_out=#{proto_path} #{File.join(proto_path, '**', '*.proto')} }
|
31
|
+
puts cmd
|
32
|
+
%x{#{cmd}}
|
33
|
+
end
|
32
34
|
end
|
33
35
|
end
|
34
36
|
end
|