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