Sha256: 1e39b8f01be69d35ad349c10b71ad8a10d47b87bc9a441a1e4fb1db28cff44e8

Contents?: true

Size: 1.58 KB

Versions: 29

Compression:

Stored size: 1.58 KB

Contents

require 'simplecov'
SimpleCov.start

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

$: << ::File.expand_path('..', File.dirname(__FILE__))
$: << ::File.expand_path('../spec/support', File.dirname(__FILE__))
#$: << ::File.expand_path('../lib', File.dirname(__FILE__))

require 'protobuf'
require ::File.dirname(__FILE__) + '/support/all'

# Including a way to turn on debug logger for spec runs
if ENV["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 defined?(JRUBY_VERSION)
      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{ rprotoc --proto_path=#{proto_path} --ruby_out=#{proto_path} #{File.join(proto_path, '**', '*.proto')} }
        puts cmd
        %x{#{cmd}}
      end
    end
  end
end

Dir[File.expand_path('../support/**/*.pb.rb', __FILE__)].each do |proto_file|
  require proto_file
end

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

29 entries across 29 versions & 1 rubygems

Version Path
protobuf-2.7.12 spec/spec_helper.rb
protobuf-2.8.0.beta9-java spec/spec_helper.rb
protobuf-2.8.0.beta9 spec/spec_helper.rb
protobuf-2.8.0.beta8-java spec/spec_helper.rb
protobuf-2.8.0.beta8 spec/spec_helper.rb
protobuf-2.8.0.beta6-java spec/spec_helper.rb
protobuf-2.8.0.beta6 spec/spec_helper.rb
protobuf-2.8.0.beta5-java spec/spec_helper.rb
protobuf-2.8.0.beta5 spec/spec_helper.rb
protobuf-2.8.0.beta4-java spec/spec_helper.rb
protobuf-2.8.0.beta4 spec/spec_helper.rb
protobuf-2.8.0.beta3-java spec/spec_helper.rb
protobuf-2.8.0.beta3 spec/spec_helper.rb
protobuf-2.8.0.beta2-java spec/spec_helper.rb
protobuf-2.8.0.beta2 spec/spec_helper.rb
protobuf-2.7.11-java spec/spec_helper.rb
protobuf-2.7.11 spec/spec_helper.rb
protobuf-2.8.0.beta1-java spec/spec_helper.rb
protobuf-2.8.0.beta1 spec/spec_helper.rb
protobuf-2.7.10-java spec/spec_helper.rb