Class: ODDB::FiPDF::TestFormat
- Defined in:
- ext/fipdf/test/format_test.rb
Defined Under Namespace
Classes: StubWriter
Instance Method Summary collapse
- #setup ⇒ Object
- #test_get_height ⇒ Object
- #test_line_count ⇒ Object
- #test_line_count_break ⇒ Object
- #test_spacing_after ⇒ Object
- #test_spacing_before ⇒ Object
Instance Method Details
#setup ⇒ Object
35 36 37 38 |
# File 'ext/fipdf/test/format_test.rb', line 35 def setup @format = Format.new @writer = StubWriter.new end |
#test_get_height ⇒ Object
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_count ⇒ Object
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_break ⇒ Object
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_after ⇒ Object
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_before ⇒ Object
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 |