Module: Module::MultipleAttributes::Etest

Defined in:
lib/vex/base/object/multiple_attributes.rb

Defined Under Namespace

Classes: X

Instance Method Summary collapse

Instance Method Details

#test_maObject


36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# File 'lib/vex/base/object/multiple_attributes.rb', line 36

def test_ma
  x = X.new
  assert_equal %w(a b c d e), [ x.a, x.b, x.c, x.d, x.e ]

  assert_raise(NoMethodError) {
    x.a = 1
  }

  assert_raise(NoMethodError) {
    x.b = 1
  }

  assert_raise(NoMethodError) {
    x.c = 1
  }

  x.d = 1
  x.e = 2
  
  assert_equal 1, x.d
  assert_equal 2, x.e
end