Class: ODDB::TestCyP450Connection

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

Instance Method Summary (collapse)

Instance Method Details

- (Object) setup



45
46
47
# File 'test/test_model/cyp450connection.rb', line 45

def setup
  @connection = ODDB::CyP450Connection.new
end

- (Object) test_cyp_id



60
61
62
63
64
# File 'test/test_model/cyp450connection.rb', line 60

def test_cyp_id
  assert_nil @connection.cyp_id
  @connection.cyp450 = flexmock :cyp_id => 'cyp-id'
  assert_equal 'cyp-id', @connection.cyp_id
end

- (Object) test_init



48
49
50
51
52
53
54
55
56
57
58
59
# File 'test/test_model/cyp450connection.rb', line 48

def test_init
  pointer = ODDB::Persistence::Pointer.new(:conn)
  @connection.pointer = pointer
  @connection.init
  expected = [ 
    ":!conn,", 
    @connection.oid.to_s, 
    "." 
  ].join
  result = @connection.pointer.to_s
  assert_equal(expected, result)
end