html-table 1.5.2 → 1.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (59) hide show
  1. checksums.yaml +4 -4
  2. checksums.yaml.gz.sig +0 -0
  3. data.tar.gz.sig +0 -0
  4. data/{CHANGES → CHANGES.rdoc} +22 -0
  5. data/Gemfile +7 -0
  6. data/LICENSE +177 -0
  7. data/MANIFEST.rdoc +57 -0
  8. data/README.rdoc +132 -0
  9. data/Rakefile +117 -146
  10. data/doc/table.rdoc +2 -4
  11. data/html-table.gemspec +6 -7
  12. data/lib/html/caption.rb +2 -2
  13. data/lib/html/col.rb +2 -2
  14. data/lib/html/colgroup.rb +4 -4
  15. data/lib/html/content.rb +2 -2
  16. data/lib/html/data.rb +2 -2
  17. data/lib/html/header.rb +2 -2
  18. data/lib/html/mixin/attribute_handler.rb +407 -0
  19. data/lib/html/mixin/html_handler.rb +124 -0
  20. data/lib/html/mixin/strongtyping.rb +17 -0
  21. data/lib/html/mixin/tag_handler.rb +125 -0
  22. data/lib/html/row.rb +2 -2
  23. data/lib/html/table.rb +7 -7
  24. data/lib/html/tablesection.rb +2 -2
  25. data/spec/attribute_handler_spec.rb +360 -0
  26. data/spec/body_spec.rb +81 -0
  27. data/spec/caption_spec.rb +74 -0
  28. data/spec/colgroup_col_spec.rb +34 -0
  29. data/spec/colgroup_spec.rb +83 -0
  30. data/spec/data_spec.rb +72 -0
  31. data/spec/foot_spec.rb +104 -0
  32. data/spec/head_spec.rb +101 -0
  33. data/spec/header_spec.rb +72 -0
  34. data/spec/html_handler_spec.rb +32 -0
  35. data/spec/row_spec.rb +136 -0
  36. data/spec/table_spec.rb +152 -0
  37. data/spec/tablesection_spec.rb +36 -0
  38. data/spec/tag_handler_spec.rb +85 -0
  39. metadata +55 -66
  40. metadata.gz.sig +0 -0
  41. data/MANIFEST +0 -59
  42. data/README +0 -132
  43. data/lib/html/attribute_handler.rb +0 -403
  44. data/lib/html/html_handler.rb +0 -120
  45. data/lib/html/tag_handler.rb +0 -121
  46. data/test/test_attribute_handler.rb +0 -361
  47. data/test/test_body.rb +0 -87
  48. data/test/test_caption.rb +0 -80
  49. data/test/test_col.rb +0 -40
  50. data/test/test_colgroup.rb +0 -89
  51. data/test/test_data.rb +0 -77
  52. data/test/test_foot.rb +0 -111
  53. data/test/test_head.rb +0 -104
  54. data/test/test_header.rb +0 -77
  55. data/test/test_html_handler.rb +0 -37
  56. data/test/test_row.rb +0 -141
  57. data/test/test_table.rb +0 -159
  58. data/test/test_tablesection.rb +0 -42
  59. data/test/test_tag_handler.rb +0 -90
@@ -1,42 +0,0 @@
1
- ################################################
2
- # test_tablesection.rb
3
- #
4
- # Test suite for the Table::TableSection class
5
- ################################################
6
- require "test-unit"
7
- require "html/table"
8
- include HTML
9
-
10
- class TC_HTML_Table_TableSection < Test::Unit::TestCase
11
- def setup
12
- @table = Table.new
13
- @tsection = Table::TableSection.new
14
- end
15
-
16
- def test_indent_level
17
- assert_respond_to(Table::Caption,:indent_level)
18
- assert_respond_to(Table::Caption,:indent_level=)
19
- assert_raises(ArgumentTypeError){ Table::Caption.indent_level = "foo" }
20
- assert_nothing_raised{ Table::Caption.indent_level = 3 }
21
- end
22
-
23
- def test_indices
24
- assert_raises(ArgumentTypeError){ @tsection[0] = "foo" }
25
- assert_nothing_raised{ @tsection[0] = Table::Row.new }
26
- end
27
-
28
- def test_push
29
- assert_raises(ArgumentTypeError){ @tsection.push("foo") }
30
- assert_nothing_raised{ @tsection.push(Table::Row.new) }
31
- end
32
-
33
- def test_unshift
34
- assert_raises(ArgumentTypeError){ @tsection.unshift("foo") }
35
- assert_nothing_raised{ @tsection.unshift(Table::Row.new) }
36
- end
37
-
38
- def teardown
39
- @table = nil
40
- @tsection = nil
41
- end
42
- end
@@ -1,90 +0,0 @@
1
- ############################################################################
2
- # test_tag_handler.rb
3
- #
4
- # Test suite for the TagHandler module. For these tests, we'll use an
5
- # instance of the Table class where the module has been mixed in.
6
- ############################################################################
7
- require 'test-unit'
8
- require 'html/table'
9
- include HTML
10
-
11
- class TC_TagHandler < Test::Unit::TestCase
12
- def self.startup
13
- BlinkWarning.disable
14
- end
15
-
16
- def setup
17
- @tcontent = Table::Content.new('test')
18
- end
19
-
20
- def test_bold
21
- assert_respond_to(@tcontent, :bold)
22
- assert_respond_to(@tcontent, :bold=)
23
- assert_nothing_raised{ @tcontent.bold }
24
- assert_nothing_raised{ @tcontent.bold = true }
25
- end
26
-
27
- def test_big
28
- assert_respond_to(@tcontent, :big)
29
- assert_respond_to(@tcontent, :big=)
30
- assert_nothing_raised{ @tcontent.big }
31
- assert_nothing_raised{ @tcontent.big = true }
32
- end
33
-
34
- def test_blink
35
- assert_respond_to(@tcontent, :blink)
36
- assert_respond_to(@tcontent, :blink=)
37
- assert_nothing_raised{ @tcontent.blink }
38
- assert_nothing_raised{ @tcontent.blink = true }
39
- end
40
-
41
- def test_italic
42
- assert_respond_to(@tcontent, :italic)
43
- assert_respond_to(@tcontent, :italic=)
44
- assert_nothing_raised{ @tcontent.italic }
45
- assert_nothing_raised{ @tcontent.italic = true }
46
- end
47
-
48
- def test_strike
49
- assert_respond_to(@tcontent, :strike)
50
- assert_respond_to(@tcontent, :strike=)
51
- assert_nothing_raised{ @tcontent.strike }
52
- assert_nothing_raised{ @tcontent.strike = true }
53
- end
54
-
55
- def test_sub
56
- assert_respond_to(@tcontent, :sub)
57
- assert_respond_to(@tcontent, :sub)
58
- assert_nothing_raised{ @tcontent.sub }
59
- assert_nothing_raised{ @tcontent.sub = true }
60
- end
61
-
62
- def test_sup
63
- assert_respond_to(@tcontent, :sup)
64
- assert_respond_to(@tcontent, :sup)
65
- assert_nothing_raised{ @tcontent.sup }
66
- assert_nothing_raised{ @tcontent.sup = true }
67
- end
68
-
69
- def test_tt
70
- assert_respond_to(@tcontent, :tt)
71
- assert_respond_to(@tcontent, :tt)
72
- assert_nothing_raised{ @tcontent.tt }
73
- assert_nothing_raised{ @tcontent.tt = true }
74
- end
75
-
76
- def test_underline
77
- assert_respond_to(@tcontent, :underline)
78
- assert_respond_to(@tcontent, :underline)
79
- assert_nothing_raised{ @tcontent.underline }
80
- assert_nothing_raised{ @tcontent.underline = true }
81
- end
82
-
83
- def teardown
84
- @tcontent = nil
85
- end
86
-
87
- def self.shutdown
88
- BlinkWarning.enable
89
- end
90
- end