Sha256: afeaf0148aad7a231138347ff3be67b162a68baa8b532d9af9e824c05de5429a

Contents?: true

Size: 797 Bytes

Versions: 34

Compression:

Stored size: 797 Bytes

Contents

require 'test_helper'

class CassandraObject::InspectTest < CassandraObject::TestCase
  test 'attribute_for_inspect' do
    object = temp_object do
      string :long_string
      time :the_time
      integer :other
    end

    assert_equal "#{'x' * 51}...".inspect, object.new(long_string: 'x' * 100).attribute_for_inspect(:long_string)
    assert_equal "2012-02-14 12:01:02".inspect, object.new(the_time: Time.new(2012, 02, 14, 12, 01, 02)).attribute_for_inspect(:the_time)
    assert_equal "5", object.new(other: 5).attribute_for_inspect(:other)
  end

  test 'inspect' do
    object = temp_object do
      string :description
      integer :price
    end.new(description: "yeah buddy", price: 42)

    assert_match /id/, object.inspect
    assert_match /description/, object.inspect
  end
end

Version data entries

34 entries across 34 versions & 1 rubygems

Version Path
gotime-cassandra_object-4.4.0 test/unit/inspect_test.rb
gotime-cassandra_object-4.3.2 test/unit/inspect_test.rb
gotime-cassandra_object-4.3.1 test/unit/inspect_test.rb
gotime-cassandra_object-4.3.0 test/unit/inspect_test.rb
gotime-cassandra_object-4.2.2 test/unit/inspect_test.rb
gotime-cassandra_object-4.2.0 test/unit/inspect_test.rb
gotime-cassandra_object-4.1.0 test/unit/inspect_test.rb
gotime-cassandra_object-4.0.2 test/unit/inspect_test.rb
gotime-cassandra_object-4.0.1 test/unit/inspect_test.rb
gotime-cassandra_object-4.0.0 test/unit/inspect_test.rb
gotime-cassandra_object-3.0.5 test/unit/inspect_test.rb
gotime-cassandra_object-3.0.4 test/unit/inspect_test.rb
gotime-cassandra_object-3.0.3 test/unit/inspect_test.rb
gotime-cassandra_object-3.0.2 test/unit/inspect_test.rb
gotime-cassandra_object-3.0.1 test/unit/inspect_test.rb
gotime-cassandra_object-3.0.0 test/unit/inspect_test.rb
gotime-cassandra_object-2.13.0 test/unit/inspect_test.rb
gotime-cassandra_object-2.12.5 test/unit/inspect_test.rb
gotime-cassandra_object-2.12.4 test/unit/inspect_test.rb
gotime-cassandra_object-2.12.3 test/unit/inspect_test.rb