Sha256: 50c8f7210f4e2f7e2825862264c73023e74eeb143dfc9dd511ac2b343af5d86c

Contents?: true

Size: 967 Bytes

Versions: 10

Compression:

Stored size: 967 Bytes

Contents

require File.join(File.dirname(__FILE__), '..', '..', 'lib', 'bson')
require 'rubygems' if RUBY_VERSION < '1.9.0' && ENV['C_EXT']
require 'test/unit'

def silently
  warn_level = $VERBOSE
  $VERBOSE = nil
  result = yield
  $VERBOSE = warn_level
  result
end

begin
  require 'rubygems' if RUBY_VERSION < "1.9.0" && !ENV['C_EXT']
  silently { require 'shoulda' }
  silently { require 'mocha' }
rescue LoadError
  puts <<MSG

This test suite requires shoulda and mocha.
You can install them as follows:
  gem install shoulda
  gem install mocha

MSG

  exit
end

require 'bson_ext/cbson' if !(RUBY_PLATFORM =~ /java/) && ENV['C_EXT']

class Test::Unit::TestCase
  include BSON

  def assert_raise_error(klass, message)
    begin
      yield
    rescue => e
      assert_equal klass, e.class
      assert e.message.include?(message), "#{e.message} does not include #{message}."
    else
      flunk "Expected assertion #{klass} but none was raised."
    end
  end

end

Version data entries

10 entries across 10 versions & 3 rubygems

Version Path
jmongo-1.1.5 test/bson/test_helper.rb
jmongo-1.1.4 test/bson/test_helper.rb
jmongo-1.1.3 test/bson/test_helper.rb
bson-1.4.1-jruby test/bson/test_helper.rb
jmongo-1.1.2 test/bson/test_helper.rb
jmongo-1.1.1 test/bson/test_helper.rb
jmongo-1.1.0 test/bson/test_helper.rb
bson-1.4.0-jruby test/bson/test_helper.rb
bson-1.4.0 test/bson/test_helper.rb
mongo-1.4.0 test/bson/test_helper.rb