Sha256: bc1c58a2b49668215cd916f6487e6ea79611fdbab79ae97ae2c9d0de44609710

Contents?: true

Size: 1.01 KB

Versions: 7

Compression:

Stored size: 1.01 KB

Contents

require 'test_helper'

class TestAttribute < ::Test::Unit::TestCase

  def test_DEFAULT_OPTIONS
    assert_equal :always, MLS::Attribute::DEFAULT_OPTIONS[:serialize]
  end

  def test_attr_readers
    attribute = MLS::Attribute.new(:name => "blah")

    assert attribute.respond_to?(:model)
    assert attribute.respond_to?(:name)
    assert attribute.respond_to?(:instance_variable_name)
    assert attribute.respond_to?(:options)
    assert attribute.respond_to?(:default)
    assert attribute.respond_to?(:reader_visibility)
    assert attribute.respond_to?(:writer_visibility)
  end

  def test_instance_methods
    attribute = MLS::Attribute.new(:name => "blah")

    assert attribute.respond_to?(:set_default_value)
    assert attribute.respond_to?(:determine_visibility)
  end

  def test_class_methods
    assert MLS::Attribute.respond_to?(:determine_class)
    assert MLS::Attribute.respond_to?(:inherited)
    assert MLS::Attribute.respond_to?(:demodulized_names)
    assert MLS::Attribute.respond_to?(:find_class)
  end

end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
mls-0.14.0 test/units/test_property.rb
mls-0.13.0 test/units/test_property.rb
mls-0.12.5 test/units/test_property.rb
mls-0.12.4 test/units/test_property.rb
mls-0.12.2 test/units/test_property.rb
mls-0.12.3 test/units/test_property.rb
mls-0.12.1 test/units/test_property.rb