diff options
author | Tim Emiola <temiola@google.com> | 2015-01-29 16:27:07 -0800 |
---|---|---|
committer | Tim Emiola <temiola@google.com> | 2015-01-31 17:55:24 -0800 |
commit | 36066537cf6e6929c03cf3689d0bd633a6325c5e (patch) | |
tree | 0278f1fe942cf7fc934f8dd460b073e3adef11eb /src/ruby | |
parent | 3306139df0a846fa717b14a23ea71fd30ad1539b (diff) |
Fix lint errors, other cleanups
- ensure that lint check gets run when prior to running unittests
- fixes a description of the default rake command
- adds a dependency on Faraday, a HTTP/REST client
Diffstat (limited to 'src/ruby')
-rwxr-xr-x | src/ruby/Rakefile | 10 | ||||
-rwxr-xr-x | src/ruby/bin/interop/interop_client.rb | 1 | ||||
-rwxr-xr-x | src/ruby/grpc.gemspec | 1 | ||||
-rw-r--r-- | src/ruby/spec/channel_spec.rb | 4 |
4 files changed, 9 insertions, 7 deletions
diff --git a/src/ruby/Rakefile b/src/ruby/Rakefile index 5fc325ef0e..b27305d16c 100755 --- a/src/ruby/Rakefile +++ b/src/ruby/Rakefile @@ -35,18 +35,20 @@ namespace :spec do t.pattern = spec_files t.rspec_opts = "--tag #{suite[:tag]}" if suite[:tag] - t.rspec_opts = suite[:tags].map{ |t| "--tag #{t}" }.join(' ') if suite[:tags] + if suite[:tags] + t.rspec_opts = suite[:tags].map { |x| "--tag #{x}" }.join(' ') + end end end end end -desc 'Run compiles the extension, runs all the tests' +desc 'Compiles the extension then runs all the tests' task :all task default: :all -task 'spec:suite:wrapper' => :compile +task 'spec:suite:wrapper' => [:compile, :rubocop] task 'spec:suite:idiomatic' => 'spec:suite:wrapper' task 'spec:suite:bidi' => 'spec:suite:wrapper' task 'spec:suite:server' => 'spec:suite:wrapper' -task :all => ['spec:suite:idiomatic', 'spec:suite:bidi', 'spec:suite:server'] +task all: ['spec:suite:idiomatic', 'spec:suite:bidi', 'spec:suite:server'] diff --git a/src/ruby/bin/interop/interop_client.rb b/src/ruby/bin/interop/interop_client.rb index 86739b7b67..63d3bd8530 100755 --- a/src/ruby/bin/interop/interop_client.rb +++ b/src/ruby/bin/interop/interop_client.rb @@ -79,7 +79,6 @@ end RX_CERT = /-----BEGIN CERTIFICATE-----\n.*?-----END CERTIFICATE-----\n/m - # creates a Credentials from the production certificates. def prod_creds cert_text = load_prod_cert diff --git a/src/ruby/grpc.gemspec b/src/ruby/grpc.gemspec index 9d95db545f..3938e0c436 100755 --- a/src/ruby/grpc.gemspec +++ b/src/ruby/grpc.gemspec @@ -20,6 +20,7 @@ Gem::Specification.new do |s| s.require_paths = ['lib'] s.platform = Gem::Platform::RUBY + s.add_dependency 'faraday', '~> 0.9' s.add_dependency 'google-protobuf', '~> 3.0.0alpha.1.1' s.add_dependency 'logging', '~> 1.8' s.add_dependency 'minitest', '~> 5.4' # reqd for interop tests diff --git a/src/ruby/spec/channel_spec.rb b/src/ruby/spec/channel_spec.rb index 189d1c67ab..82c7915deb 100644 --- a/src/ruby/spec/channel_spec.rb +++ b/src/ruby/spec/channel_spec.rb @@ -29,8 +29,6 @@ require 'grpc' -FAKE_HOST='localhost:0' - def load_test_certs test_root = File.join(File.dirname(__FILE__), 'testdata') files = ['ca.pem', 'server1.key', 'server1.pem'] @@ -38,6 +36,8 @@ def load_test_certs end describe GRPC::Core::Channel do + FAKE_HOST = 'localhost:0' + def create_test_cert GRPC::Core::Credentials.new(load_test_certs[0]) end |