Sha256: 77318011702c24423a82eef48303f5a9764e988bed4540bc40bc687b3ea8d424

Contents?: true

Size: 1.98 KB

Versions: 3

Compression:

Stored size: 1.98 KB

Contents

# Author:: Couchbase <info@couchbase.com>
# Copyright:: 2011, 2012 Couchbase, Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

gem 'minitest'
require 'coveralls'
Coveralls.wear!
require 'minitest'
gem 'mocha'
require 'mocha/setup'
require 'couchbase'
require 'open-uri'
require 'ostruct'
require_relative 'mock'
require 'pry'

# Surpress connection logging
# java_import java.lang.System
# java_import java.util.logging.Logger
# java_import java.util.logging.Level

# properties = System.getProperties
# properties.put("net.spy.log.LoggerImpl", "net.spy.memcached.compat.log.Log4JLogger")
# System.setProperties(properties)

# Logger.getLogger('net.spy.memcached').setLevel(Level::SEVERE)
# Logger.getLogger('com.couchbase.client').setLevel(Level::SEVERE)
# Logger.getLogger('com.couchbase.client.vbucket').setLevel(Level::SEVERE)

# $stderr = StringIO.new

class Minitest::Test

  def cb
    Couchbase.bucket
  end

  def with_configs(configs = {})
    configs = Couchbase::Bucket::DEFAULT_OPTIONS.merge(configs)
    if configs[:host].nil?
      configs[:host] = configs[:hostname]
    end
    yield OpenStruct.new(configs)
  end

  def uniq_id(*suffixes)
    test_id = [caller.first[/.*[` ](.*)'/, 1], suffixes].compact.join("_")
    @ids ||= {}
    @ids[test_id] ||= Time.now.to_f
    [test_id, @ids[test_id]].join("_")
  end

end

at_exit {
  $mock = start_mock
  exit_code = Minitest.run(ARGV)
  Couchbase.disconnect
  $mock.stop
  java.lang.System.exit(exit_code ? 0 : 1)
}

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
couchbase-jruby-client-0.2.2-java test/setup.rb
couchbase-jruby-client-0.2.1-java test/setup.rb
couchbase-jruby-client-0.2.0-java test/setup.rb