html-table 1.2.2 → 1.3.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.
data/test/tc_row.rb CHANGED
@@ -34,6 +34,13 @@ class TC_HTML_Table_Row < Test::Unit::TestCase
34
34
  html = "<tr></tr>"
35
35
  assert_equal(html,@tr.html.gsub(/\s+/,''))
36
36
  end
37
+
38
+ def test_header
39
+ assert_respond_to(@tr, :header?)
40
+ assert_respond_to(@tr, :header=)
41
+ assert_nothing_raised{ @tr.header? }
42
+ assert_nothing_raised{ @tr.header = true }
43
+ end
37
44
 
38
45
  def test_with_attributes
39
46
  html = "<tr align='center'></tr>"
@@ -66,13 +73,19 @@ class TC_HTML_Table_Row < Test::Unit::TestCase
66
73
  assert_nothing_raised{ @tr << Table::Row::Data.new }
67
74
  assert_nothing_raised{ @tr << Table::Row::Header.new }
68
75
  end
76
+
77
+ def test_header_in_constructor
78
+ assert_nothing_raised{ @tr = Table::Row.new('test', true) }
79
+ html = "<tr><th>test</th></tr>"
80
+ assert_equal(html, @tr.html.gsub(/\s+/,''))
81
+ end
69
82
 
70
83
  def test_push_single_data_element
71
84
  html = "<tr><td>hello</td></tr>"
72
85
  @tr.push Table::Row::Data.new{ |d| d.content = "hello" }
73
86
  assert_equal(html,@tr.html.gsub(/\s{2,}|\n+/,''))
74
87
  end
75
-
88
+
76
89
  def test_push_multiple_data_element
77
90
  html = "<tr><td>hello</td><td>world</td></tr>"
78
91
  d1 = Table::Row::Data.new{ |d| d.content = "hello" }
data/test/tc_table.rb CHANGED
@@ -25,7 +25,7 @@ class TC_HTML_Table < Test::Unit::TestCase
25
25
  end
26
26
 
27
27
  def test_version
28
- assert_equal("1.2.2", Table::VERSION)
28
+ assert_equal('1.3.0', Table::VERSION)
29
29
  end
30
30
 
31
31
  def test_constructor
@@ -0,0 +1,92 @@
1
+ ############################################################################
2
+ # tc_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
+ base = File.basename(Dir.pwd)
8
+
9
+ if base == 'test' || base =~ /html-table/
10
+ Dir.chdir('..') if base == 'test'
11
+ $LOAD_PATH.unshift(Dir.pwd)
12
+ $LOAD_PATH.unshift(Dir.pwd + '/lib')
13
+ $LOAD_PATH.unshift(Dir.pwd + '/lib/html')
14
+ Dir.chdir('test') rescue nil
15
+ end
16
+
17
+ require 'test/unit'
18
+ require 'html/table'
19
+ include HTML
20
+
21
+ class TC_TagHandler < Test::Unit::TestCase
22
+ def setup
23
+ @content = Table::Content.new('test')
24
+ end
25
+
26
+ def test_bold
27
+ assert_respond_to(@content, :bold)
28
+ assert_respond_to(@content, :bold=)
29
+ assert_nothing_raised{ @content.bold }
30
+ assert_nothing_raised{ @content.bold = true }
31
+ end
32
+
33
+ def test_big
34
+ assert_respond_to(@content, :big)
35
+ assert_respond_to(@content, :big=)
36
+ assert_nothing_raised{ @content.big }
37
+ assert_nothing_raised{ @content.big = true }
38
+ end
39
+
40
+ def test_blink
41
+ assert_respond_to(@content, :blink)
42
+ assert_respond_to(@content, :blink=)
43
+ assert_nothing_raised{ @content.blink }
44
+ assert_nothing_raised{ @content.blink = true }
45
+ end
46
+
47
+ def test_italic
48
+ assert_respond_to(@content, :italic)
49
+ assert_respond_to(@content, :italic=)
50
+ assert_nothing_raised{ @content.italic }
51
+ assert_nothing_raised{ @content.italic = true }
52
+ end
53
+
54
+ def test_strike
55
+ assert_respond_to(@content, :strike)
56
+ assert_respond_to(@content, :strike=)
57
+ assert_nothing_raised{ @content.strike }
58
+ assert_nothing_raised{ @content.strike = true }
59
+ end
60
+
61
+ def test_sub
62
+ assert_respond_to(@content, :sub)
63
+ assert_respond_to(@content, :sub)
64
+ assert_nothing_raised{ @content.sub }
65
+ assert_nothing_raised{ @content.sub = true }
66
+ end
67
+
68
+ def test_sup
69
+ assert_respond_to(@content, :sup)
70
+ assert_respond_to(@content, :sup)
71
+ assert_nothing_raised{ @content.sup }
72
+ assert_nothing_raised{ @content.sup = true }
73
+ end
74
+
75
+ def test_tt
76
+ assert_respond_to(@content, :tt)
77
+ assert_respond_to(@content, :tt)
78
+ assert_nothing_raised{ @content.tt }
79
+ assert_nothing_raised{ @content.tt = true }
80
+ end
81
+
82
+ def test_underline
83
+ assert_respond_to(@content, :underline)
84
+ assert_respond_to(@content, :underline)
85
+ assert_nothing_raised{ @content.underline }
86
+ assert_nothing_raised{ @content.underline = true }
87
+ end
88
+
89
+ def teardown
90
+ @content = nil
91
+ end
92
+ end
data/test/ts_all.rb CHANGED
@@ -1,23 +1,24 @@
1
1
  base = File.basename(Dir.pwd)
2
2
 
3
- if base == "test" || base =~ /html-table/
4
- Dir.chdir("..") if base == "test"
3
+ if base == 'test' || base =~ /html-table/
4
+ Dir.chdir('..') if base == 'test'
5
5
  $LOAD_PATH.unshift(Dir.pwd)
6
- $LOAD_PATH.unshift(Dir.pwd + "/lib")
7
- $LOAD_PATH.unshift(Dir.pwd + "/lib/html")
8
- Dir.chdir("test") rescue nil
6
+ $LOAD_PATH.unshift(Dir.pwd + '/lib')
7
+ $LOAD_PATH.unshift(Dir.pwd + '/lib/html')
8
+ Dir.chdir('test') rescue nil
9
9
  end
10
10
 
11
- require "tc_table"
12
- require "tc_row"
13
- require "tc_colgroup"
14
- require "tc_caption"
15
- require "tc_data"
16
- require "tc_header"
17
- require "tc_col"
18
- require "tc_head"
19
- require "tc_foot"
20
- require "tc_body"
21
- require "tc_tablesection"
22
- require "tc_attribute_handler"
23
- require "tc_html_handler"
11
+ require 'tc_table'
12
+ require 'tc_row'
13
+ require 'tc_colgroup'
14
+ require 'tc_caption'
15
+ require 'tc_data'
16
+ require 'tc_header'
17
+ require 'tc_col'
18
+ require 'tc_head'
19
+ require 'tc_foot'
20
+ require 'tc_body'
21
+ require 'tc_tablesection'
22
+ require 'tc_attribute_handler'
23
+ require 'tc_html_handler'
24
+ require 'tc_tag_handler'
metadata CHANGED
@@ -1,10 +1,10 @@
1
1
  --- !ruby/object:Gem::Specification
2
- rubygems_version: 0.8.10
2
+ rubygems_version: 0.9.0
3
3
  specification_version: 1
4
4
  name: html-table
5
5
  version: !ruby/object:Gem::Version
6
- version: 1.2.2
7
- date: 2005-06-17
6
+ version: 1.3.0
7
+ date: 2006-08-02 00:00:00 -06:00
8
8
  summary: A Ruby interface for generating HTML tables
9
9
  require_paths:
10
10
  - lib
@@ -23,51 +23,57 @@ required_ruby_version: !ruby/object:Gem::Version::Requirement
23
23
  version: 0.0.0
24
24
  version:
25
25
  platform: ruby
26
+ signing_key:
27
+ cert_chain:
28
+ post_install_message:
26
29
  authors:
27
30
  - Daniel J. Berger
28
31
  files:
32
+ - lib/html/data.rb
33
+ - lib/html/html_handler.rb
29
34
  - lib/html/attribute_handler.rb
30
- - lib/html/body.rb
31
- - lib/html/caption.rb
35
+ - lib/html/header.rb
36
+ - lib/html/tablesection.rb
37
+ - lib/html/tag_handler.rb
38
+ - lib/html/content.rb
32
39
  - lib/html/col.rb
33
- - lib/html/colgroup.rb
34
- - lib/html/data.rb
35
40
  - lib/html/foot.rb
41
+ - lib/html/table.rb
42
+ - lib/html/colgroup.rb
36
43
  - lib/html/head.rb
37
- - lib/html/header.rb
38
- - lib/html/html_handler.rb
39
44
  - lib/html/row.rb
40
- - lib/html/table.rb
41
- - lib/html/tablesection.rb
42
- - lib/html/tag_handler.rb
45
+ - lib/html/caption.rb
46
+ - lib/html/body.rb
47
+ - README
43
48
  - CHANGES
44
49
  - MANIFEST
45
- - README
46
- - test/tc_attribute_handler.rb
47
- - test/tc_body.rb
48
- - test/tc_caption.rb
49
- - test/tc_col.rb
50
+ - test/tc_head.rb
50
51
  - test/tc_colgroup.rb
52
+ - test/ts_all.rb
53
+ - test/tc_caption.rb
54
+ - test/tc_body.rb
55
+ - test/tc_attribute_handler.rb
51
56
  - test/tc_data.rb
52
- - test/tc_foot.rb
53
- - test/tc_head.rb
57
+ - test/tc_col.rb
54
58
  - test/tc_header.rb
59
+ - test/tc_table.rb
55
60
  - test/tc_html_handler.rb
56
61
  - test/tc_row.rb
57
- - test/tc_table.rb
62
+ - test/tc_tag_handler.rb
58
63
  - test/tc_tablesection.rb
59
- - test/ts_all.rb
60
- - doc/attributes.rdoc
61
- - doc/table.rdoc
62
- - doc/table_body.rdoc
63
- - doc/table_caption.rdoc
64
+ - test/tc_foot.rb
65
+ - doc/table_row_data.rdoc
66
+ - doc/table_head.rdoc
67
+ - doc/table_foot.rdoc
64
68
  - doc/table_colgroup.rdoc
69
+ - doc/table_content.rdoc
65
70
  - doc/table_colgroup_col.rdoc
66
- - doc/table_foot.rdoc
67
- - doc/table_head.rdoc
71
+ - doc/table_body.rdoc
72
+ - doc/table.rdoc
68
73
  - doc/table_row.rdoc
69
- - doc/table_row_data.rdoc
70
74
  - doc/table_row_header.rdoc
75
+ - doc/attributes.rdoc
76
+ - doc/table_caption.rdoc
71
77
  test_files:
72
78
  - test/ts_all.rb
73
79
  rdoc_options: []
@@ -75,17 +81,18 @@ rdoc_options: []
75
81
  extra_rdoc_files:
76
82
  - README
77
83
  - CHANGES
78
- - doc/attributes.rdoc
79
- - doc/table.rdoc
80
- - doc/table_body.rdoc
81
- - doc/table_caption.rdoc
84
+ - doc/table_row_data.rdoc
85
+ - doc/table_head.rdoc
86
+ - doc/table_foot.rdoc
82
87
  - doc/table_colgroup.rdoc
88
+ - doc/table_content.rdoc
83
89
  - doc/table_colgroup_col.rdoc
84
- - doc/table_foot.rdoc
85
- - doc/table_head.rdoc
90
+ - doc/table_body.rdoc
91
+ - doc/table.rdoc
86
92
  - doc/table_row.rdoc
87
- - doc/table_row_data.rdoc
88
93
  - doc/table_row_header.rdoc
94
+ - doc/attributes.rdoc
95
+ - doc/table_caption.rdoc
89
96
  executables: []
90
97
 
91
98
  extensions: []