Sha256: 188fd1bd60cfebaf8a0a869cb9dfd8e3b9e977bdca79dddfbf74a549ef36b5bc

Contents?: true

Size: 790 Bytes

Versions: 27

Compression:

Stored size: 790 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.attribute_for_inspect('x' * 100)
    assert_equal "2012-02-14 12:01:02".inspect, object.new.attribute_for_inspect(Time.new(2012, 02, 14, 12, 01, 02))
    assert_equal "\"foo\"", object.new.attribute_for_inspect('foo')
  end

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

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

Version data entries

27 entries across 27 versions & 2 rubygems

Version Path
gotime-cassandra_object-4.12.2 test/unit/inspect_test.rb
gotime-cassandra_object-4.12.1 test/unit/inspect_test.rb
gotime-cassandra_object-4.12.0 test/unit/inspect_test.rb
gotime-cassandra_object-4.11.6 test/unit/inspect_test.rb
gotime-cassandra_object-4.11.5 test/unit/inspect_test.rb
gotime-cassandra_object-4.11.4 test/unit/inspect_test.rb
gotime-cassandra_object-4.11.3 test/unit/inspect_test.rb
gotime-cassandra_object-4.11.2 test/unit/inspect_test.rb
gotime-cassandra_object-4.11.1 test/unit/inspect_test.rb
gotime-cassandra_object-4.11.0 test/unit/inspect_test.rb
gotime-cassandra_object-4.10.5 test/unit/inspect_test.rb
gotime-cassandra_object-4.10.4 test/unit/inspect_test.rb
gotime-cassandra_object-4.10.3 test/unit/inspect_test.rb
gotime-cassandra_object-4.10.2 test/unit/inspect_test.rb
gotime-cassandra_object-4.10.1 test/unit/inspect_test.rb
cassandra_object_rails-0.0.1 test/unit/inspect_test.rb
gotime-cassandra_object-4.10.0 test/unit/inspect_test.rb
gotime-cassandra_object-4.9.2 test/unit/inspect_test.rb
gotime-cassandra_object-4.9.1 test/unit/inspect_test.rb
gotime-cassandra_object-4.9.0 test/unit/inspect_test.rb