Class: TestArray

Inherits:
Test::Unit::TestCase
  • Object
show all
Defined in:
test/test_util/pointerarray.rb

Instance Method Summary (collapse)

Instance Method Details

- (Object) setup



11
12
13
14
15
# File 'test/test_util/pointerarray.rb', line 11

def setup
  @values = %w{a b c d e}
  @pointer = 'Pointer'
  @array = ODDB::PointerArray.new(@values, @pointer)
end

- (Object) test_initialize



16
17
18
19
20
# File 'test/test_util/pointerarray.rb', line 16

def test_initialize
  assert_equal(@values, @array)
  assert_respond_to(@array, :pointer)
  assert_equal('Pointer', @array.pointer)
end

- (Object) test_reverse



25
26
27
28
# File 'test/test_util/pointerarray.rb', line 25

def test_reverse
  values = @array.reverse
  assert_equal(ODDB::PointerArray, values.class)  
end

- (Object) test_sort_by



21
22
23
24
# File 'test/test_util/pointerarray.rb', line 21

def test_sort_by
  values = @array.sort_by { |item| item }   
  assert_equal(ODDB::PointerArray, values.class)  
end