Sha256: 1f9f88d28fe43cb337053e9f508be0f9812aef8f518bdde7276e6df2cab31d2d

Contents?: true

Size: 503 Bytes

Versions: 12

Compression:

Stored size: 503 Bytes

Contents

require './test/test_helper'

class TiumestampTest < Test::Unit::TestCase
  include Mongo

  def test_timestamp_equality
    t1 = Timestamp.new(5000, 200)
    t2 = Timestamp.new(5000, 200)
    assert_equal t2, t1
  end

  def test_implements_array_for_backward_compatibility
    ts = Timestamp.new(5000, 200)
    assert_equal 200, ts[0]
    assert_equal 5000, ts[1]

    array = ts.map {|t| t }
    assert_equal 2, array.length

    assert_equal 200, array[0]
    assert_equal 5000, array[1]
  end

end

Version data entries

12 entries across 11 versions & 4 rubygems

Version Path
vanity-1.7.1 vendor/ruby/1.9.1/gems/bson-1.3.1/test/bson/timestamp_test.rb
vanity-1.7.1 vendor/ruby/1.9.1/gems/mongo-1.3.1/test/bson/timestamp_test.rb
jonbell-mongo-1.3.1.2 test/bson/timestamp_test.rb
bson-1.3.1-jruby test/bson/timestamp_test.rb
bson-1.3.1 test/bson/timestamp_test.rb
mongo-1.3.1 test/bson/timestamp_test.rb
bson-1.3.0-jruby test/bson/timestamp_test.rb
bson-1.3.0 test/bson/timestamp_test.rb
mongo-1.3.0 test/bson/timestamp_test.rb
bson-1.3.0.rc0-jruby test/bson/timestamp_test.rb
bson-1.3.0.rc0 test/bson/timestamp_test.rb
mongo-1.3.0.rc0 test/bson/timestamp_test.rb