Class: ODDB::TestWidowRule

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

Instance Method Summary collapse

Instance Method Details

#setupObject



81
82
83
# File 'ext/fipdf/test/rules_test.rb', line 81

def setup
	@widow_rule = ODDB::FiPDF::WidowRule.new(:widow_rule)
end

#test_widow_rule_fulfilledObject



84
85
86
87
88
89
# File 'ext/fipdf/test/rules_test.rb', line 84

def test_widow_rule_fulfilled
	@widow_rule.notify(:add_text_wrap)
	@widow_rule.notify(:add_text_wrap)
	@widow_rule.notify(:ez_new_page)
	assert_equal(true, @widow_rule.fulfilled?)
end

#test_widow_rule_not_fulfilledObject



90
91
92
93
94
95
# File 'ext/fipdf/test/rules_test.rb', line 90

def test_widow_rule_not_fulfilled
	@widow_rule.notify(:add_text_wrap)
	@widow_rule.notify(:ez_new_page)
	@widow_rule.notify(:add_text_wrap)
	assert_equal(false, @widow_rule.fulfilled?)
end

#test_widow_single_lineObject



96
97
98
99
# File 'ext/fipdf/test/rules_test.rb', line 96

def test_widow_single_line
	@widow_rule.notify(:add_text_wrap)
	assert_equal(true, @widow_rule.fulfilled?)
end