Sha256: af467503b217691813c9006b7b337702f85040348a4195428b29f8dba3be7eee

Contents?: true

Size: 1.61 KB

Versions: 14

Compression:

Stored size: 1.61 KB

Contents

require 'simplecov'
SimpleCov.start

require 'rubygems'
require 'bundler'
Bundler.setup :default, :development, :test
require 'pry'

$: << ::File.expand_path('../..', __FILE__)
$: << ::File.expand_path('../support', __FILE__)

require 'protobuf'
require ::File.expand_path('../support/all', __FILE__)

$: << ::File.expand_path("../../lib/protobuf/descriptors", __FILE__)
require 'google/protobuf/compiler/plugin.pb'

# Including a way to turn on debug logger for spec runs
if ENV.key?('DEBUG')
  debug_log = ::File.expand_path('../debug_specs.log', File.dirname(__FILE__) )
  ::Protobuf::Logger.configure(:file => debug_log, :level => ::Logger::DEBUG)
end

# Get rid of the deprecation env var if present (messes with specs).
ENV.delete("PB_IGNORE_DEPRECATIONS")

::RSpec.configure do |c|
  c.include(::Sander6::CustomMatchers)
  c.mock_with :rspec

  c.before(:suite) do
    unless ENV['NO_COMPILE_TEST_PROTOS']
      $stdout.puts 'Compiling test protos (use NO_COMPILE_TEST_PROTOS=1 to skip)'
      proto_path = File.expand_path("../support/", __FILE__)
      cmd = %Q{protoc --plugin=./bin/protoc-gen-ruby --ruby_out=#{proto_path} -I #{proto_path} #{File.join(proto_path, '**', '*.proto')}}
      puts cmd
      %x{#{cmd}}
    end
  end
end

support_proto_glob = File.expand_path('../support/**/*.pb.rb', __FILE__)
Dir[support_proto_glob].each { |proto_file| require proto_file }

class ::Protobuf::Rpc::Client
  def ==(other)
    connector.options == other.options && \
      success_cb == other.success_cb && \
      failure_cb == other.failure_cb
  end
end

def reset_service_location(service)
  service.host = nil
  service.port = nil
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
protobuf-2.8.13 spec/spec_helper.rb
protobuf-2.8.12 spec/spec_helper.rb
protobuf-2.8.11 spec/spec_helper.rb
protobuf-2.8.10 spec/spec_helper.rb
protobuf-2.8.9 spec/spec_helper.rb
protobuf-2.8.8 spec/spec_helper.rb
protobuf-2.8.7 spec/spec_helper.rb
protobuf-2.8.6 spec/spec_helper.rb
protobuf-2.8.5 spec/spec_helper.rb
protobuf-2.8.4 spec/spec_helper.rb
protobuf-2.8.3 spec/spec_helper.rb
protobuf-2.8.2 spec/spec_helper.rb
protobuf-2.8.1 spec/spec_helper.rb
protobuf-2.8.0 spec/spec_helper.rb