Sha256: e458be51cf9b21d47b418d29354ab39730826acdabe55fb96ad78d737e9c00c4

Contents?: true

Size: 661 Bytes

Versions: 11

Compression:

Stored size: 661 Bytes

Contents

require 'test_helper'

class CassandraObject::IdentityTest < CassandraObject::TestCase
  test 'id' do
    issue = Issue.create

    assert_equal issue.key.to_s, issue.id
  end

  test 'equality of new records' do
    assert_not_equal Issue.new, Issue.new
  end

  test 'equality' do
    first_issue = Issue.create
    second_issue = Issue.create

    assert_equal first_issue, first_issue
    assert_not_equal first_issue, second_issue
  end

  test 'parse_key' do
    assert_kind_of(
      CassandraObject::Identity::UUIDKeyFactory::UUID,
      Issue.parse_key('bb4cbbbc-b7c7-11e0-9ca2-732604ff41fe')
    )
    
    assert_nil Issue.parse_key('fail')
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
gotime-cassandra_object-2.7.12 test/identity_test.rb
gotime-cassandra_object-2.7.11 test/identity_test.rb
gotime-cassandra_object-2.7.10 test/identity_test.rb
gotime-cassandra_object-2.7.9 test/identity_test.rb
gotime-cassandra_object-2.7.8 test/identity_test.rb
gotime-cassandra_object-2.7.7 test/identity_test.rb
gotime-cassandra_object-2.7.6 test/identity_test.rb
gotime-cassandra_object-2.7.5 test/identity_test.rb
gotime-cassandra_object-2.7.4 test/identity_test.rb
gotime-cassandra_object-2.7.3 test/identity_test.rb
gotime-cassandra_object-2.7.2 test/identity_test.rb