Class: TestLogGroup

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

Instance Method Summary (collapse)

Instance Method Details

- (Object) setup



17
18
19
# File 'test/test_util/loggroup.rb', line 17

def setup
  @group = ODDB::LogGroup.new(:swissmedic_journal)
end

- (Object) test_create_log



39
40
41
42
43
44
# File 'test/test_util/loggroup.rb', line 39

def test_create_log
  date = Date.new(1975,8,21)
  @group.create_log(date)
  assert_equal([date], @group.logs.keys)
  assert_equal(ODDB::Log, @group.logs[date].class)
end

- (Object) test_log



31
32
33
34
35
36
37
38
# File 'test/test_util/loggroup.rb', line 31

def test_log
  foo = Object.new
  date = Date.new(1975,8,21)
  @group.logs = {
    date =>  foo
  }
  assert_equal(foo, @group.log(date))
end

- (Object) test_newest_date



20
21
22
23
24
25
26
27
28
29
30
# File 'test/test_util/loggroup.rb', line 20

def test_newest_date
  assert_nil(@group.newest_date)
  date = Date.new(1975,8,21)
  date1 = date.dup
  @group.logs = {
    date =>  Object.new
  }
  assert_equal(date, @group.newest_date)
  date = date >> 1
  assert_equal(date1, @group.newest_date)
end