Class: ODDB::FiPDF::TestFormat

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

Defined Under Namespace

Classes: StubWriter

Instance Method Summary collapse

Instance Method Details

#setupObject



35
36
37
38
# File 'ext/fipdf/test/format_test.rb', line 35

def setup
	@format = Format.new
	@writer = StubWriter.new
end

#test_get_heightObject



49
50
51
52
53
54
# File 'ext/fipdf/test/format_test.rb', line 49

def test_get_height
	@format.writer = StubWriter.new
	@format.writer.height = 8
	text = "foobaar foobaar"
	assert_equal(16, @format.get_height(text, 200))
end

#test_line_countObject



39
40
41
42
43
# File 'ext/fipdf/test/format_test.rb', line 39

def test_line_count
	@format.writer = StubWriter.new
	text = "foobaar foobaar"
	assert_equal(2, @format.line_count(text, 200))
end

#test_line_count_breakObject



44
45
46
47
48
# File 'ext/fipdf/test/format_test.rb', line 44

def test_line_count_break
	@format.writer = StubWriter.new
	text = "foobaar\nfoobaar"
	assert_equal(3, @format.line_count(text, 20000))
end

#test_spacing_afterObject



60
61
62
63
64
# File 'ext/fipdf/test/format_test.rb', line 60

def test_spacing_after
	@format.writer = StubWriter.new
	text = ""
	assert_equal(0, @format.spacing_after(text))
end

#test_spacing_beforeObject



55
56
57
58
59
# File 'ext/fipdf/test/format_test.rb', line 55

def test_spacing_before
	@format.writer = StubWriter.new
	text = ""
	assert_equal(0, @format.spacing_before(text))
end