Class: ODDB::TestOrphanRule

Inherits:
Test::Unit::TestCase
  • Object
show all
Defined in:
ext/fipdf/test/rules_test.rb

Instance Method Summary (collapse)

Instance Method Details

- (Object) setup



43
44
45
# File 'ext/fipdf/test/rules_test.rb', line 43

def setup
  @orphan_rule = ODDB::FiPDF::OrphanRule.new(:orphan_rule)
end

- (Object) test_orphan_fulfilled



46
47
48
49
50
51
# File 'ext/fipdf/test/rules_test.rb', line 46

def test_orphan_fulfilled
  @orphan_rule.notify(:add_text_wrap)
  @orphan_rule.notify(:add_text_wrap)
  @orphan_rule.notify(:ez_new_page)
  assert_equal(true, @orphan_rule.fulfilled?)
end

- (Object) test_orphan_multiple_page_breaks



71
72
73
74
75
76
77
78
# File 'ext/fipdf/test/rules_test.rb', line 71

def test_orphan_multiple_page_breaks
  @orphan_rule.notify(:add_text_wrap)
  @orphan_rule.notify(:ez_new_page)
  @orphan_rule.notify(:add_text_wrap)
  @orphan_rule.notify(:add_text_wrap)
  @orphan_rule.notify(:ez_new_page)
  assert_equal(false, @orphan_rule.fulfilled?)
end

- (Object) test_orphan_not_fulfilled



52
53
54
55
56
57
# File 'ext/fipdf/test/rules_test.rb', line 52

def test_orphan_not_fulfilled
  @orphan_rule.notify(:add_text_wrap)
  @orphan_rule.notify(:ez_new_page)
  @orphan_rule.notify(:add_text_wrap)
  assert_equal(false, @orphan_rule.fulfilled?)
end

- (Object) test_orphan_not_fulfilled2



58
59
60
61
62
63
64
65
# File 'ext/fipdf/test/rules_test.rb', line 58

def test_orphan_not_fulfilled2
  @orphan_rule.notify(:add_text_wrap)
  @orphan_rule.notify(:ez_new_page)
  @orphan_rule.notify(:add_text_wrap)
  @orphan_rule.notify(:add_text_wrap)
  @orphan_rule.notify(:add_text_wrap)
  assert_equal(false, @orphan_rule.fulfilled?)
end

- (Object) test_orphan_single_line



66
67
68
69
70
# File 'ext/fipdf/test/rules_test.rb', line 66

def test_orphan_single_line
  @orphan_rule.notify(:add_text_wrap)
  @orphan_rule.notify(:ez_new_page)
  assert_equal(true, @orphan_rule.fulfilled?)
end