Class: ODDB::TestAbstractLink

Inherits:
Test::Unit::TestCase
  • Object
show all
Defined in:
test/test_model/cyp450connection.rb

Instance Method Summary (collapse)

Instance Method Details

- (Object) setup



20
21
22
# File 'test/test_model/cyp450connection.rb', line 20

def setup
  @link = ODDB::Interaction::AbstractLink.new
end

- (Object) test_empty



23
24
25
26
27
# File 'test/test_model/cyp450connection.rb', line 23

def test_empty
  assert_equal true, @link.empty?
  @link.href = 'http://ch.oddb.org/'
  assert_equal false, @link.empty?
end

- (Object) test_eql



28
29
30
31
32
33
34
35
36
37
# File 'test/test_model/cyp450connection.rb', line 28

def test_eql
  other = ODDB::Interaction::AbstractLink.new
  assert_equal other, @link
  @link.href = 'http://ch.oddb.org/'
  assert_not_equal other, @link
  other.href = 'http://ch.oddb.org/'
  assert_equal other, @link
  other.href = 'http://de.oddb.org/'
  assert_not_equal other, @link
end

- (Object) test_hash



38
39
40
41
# File 'test/test_model/cyp450connection.rb', line 38

def test_hash
  @link.href = 'http://ch.oddb.org/'
  assert_equal 'http://ch.oddb.org/'.hash, @link.hash
end