Sha256: d9c1555a97fb3509b367aeb15aadaceae0c0b47b34d66c58eb99b7bb73550ca7

Contents?: true

Size: 632 Bytes

Versions: 8

Compression:

Stored size: 632 Bytes

Contents

require 'test_helper'

class CassandraObject::AttributesTest < CassandraObject::TestCase
  class TestIssue < CassandraObject::Base
    self.column_family = 'Issue'
  end

  class TestChildIssue < TestIssue
    attribute :description, type: :string
  end

  test 'attributes not shared' do
    assert_nothing_raised { Issue.new.description }
    assert_raise(NoMethodError) { TestIssue.new.description }
    assert_nothing_raised { TestChildIssue.new.description }
  end

  test 'attributes setter' do
    issue = Issue.new

    issue.attributes = {
      description: 'foo'
    }

    assert_equal 'foo', issue.description
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
gotime-cassandra_object-2.4.2 test/attributes_test.rb
gotime-cassandra_object-2.4.1 test/attributes_test.rb
gotime-cassandra_object-2.4.0 test/attributes_test.rb
gotime-cassandra_object-2.3.6 test/attributes_test.rb
gotime-cassandra_object-2.3.5 test/attributes_test.rb
gotime-cassandra_object-2.3.4 test/attributes_test.rb
gotime-cassandra_object-2.3.3 test/attributes_test.rb
gotime-cassandra_object-2.3.2 test/attributes_test.rb