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.
@@ -1,14 +1,17 @@
1
1
  module HTML
2
2
  # Superclass for THEAD, TBODY, TFOOT
3
+ #
3
4
  class Table::TableSection < Array
4
5
  include AttributeHandler
5
6
  include HtmlHandler
6
- def initialize
7
- yield self if block_given?
7
+
8
+ def initialize(&block)
9
+ instance_eval(&block) if block_given?
8
10
  end
9
11
 
10
12
  # Adds a Table::Row object as content. The +arg+ is passed as the value
11
13
  # to the Table::Row constructor.
14
+ #
12
15
  def content=(arg)
13
16
  tr = Table::Row.new(arg)
14
17
  self.push(tr)
@@ -19,8 +22,8 @@ module HTML
19
22
  end
20
23
 
21
24
  def self.indent_level=(num)
22
- expect(num,Integer)
23
- raise ArgumentError,"indent_level must be >= 0" if num < 0
25
+ expect(num, Integer)
26
+ raise ArgumentError, "indent_level must be >= 0" if num < 0
24
27
  @indent_level = num
25
28
  end
26
29
 
@@ -2,63 +2,113 @@
2
2
  # tag_handler.rb
3
3
  #
4
4
  # Module for handling standard html physical tags (<b>, <i>, etc).
5
- # Only used for Table objects that contain text content. That
6
- # means Table::Row::Data, Table::Row::Header and Table::Caption.
5
+ # Only used for Table::Content objects, which are in turn used by
6
+ # Table::Row::Data, Table::Row::Header and Table::Caption.
7
7
  ###################################################################
8
- module Tag_Handler
8
+ module TagHandler
9
+ def bold(bool = nil)
10
+ self.bold = bool if bool
11
+ @bold
12
+ end
9
13
 
10
14
  def bold=(bool)
11
- handle_physical_tag('b',bool)
15
+ handle_physical_tag('b', bool)
16
+ @bold = bool
17
+ end
18
+
19
+ def big(bool = nil)
20
+ self.big = bool if bool
21
+ @big
12
22
  end
13
23
 
14
24
  def big=(bool)
15
- handle_physical_tag('big',bool)
25
+ handle_physical_tag('big', bool)
26
+ @big = bool
27
+ end
28
+
29
+ def blink(bool = nil)
30
+ self.blink = bool if bool
31
+ @blink
16
32
  end
17
33
 
18
34
  def blink=(bool)
19
35
  if $VERBOSE
20
36
  STDERR.puts("The 'blink' tag is very annoying. Please reconsider.")
21
37
  end
22
- handle_physical_tag('blink',bool)
38
+ handle_physical_tag('blink', bool)
39
+ @blink = bool
40
+ end
41
+
42
+ def italic(bool = nil)
43
+ self.italic = bool if bool
44
+ @italic
23
45
  end
24
46
 
25
47
  def italic=(bool)
26
- handle_physical_tag('i',bool)
48
+ handle_physical_tag('i', bool)
49
+ @italic = bool
50
+ end
51
+
52
+ def strike(bool = nil)
53
+ self.strike = bool if bool
54
+ @strike
27
55
  end
28
56
 
29
57
  def strike=(bool)
30
- handle_physical_tag('strike',bool)
58
+ handle_physical_tag('strike', bool)
59
+ @strike = bool
60
+ end
61
+
62
+ def sub(bool = nil)
63
+ self.sub = bool if bool
64
+ @sub
31
65
  end
32
66
 
33
67
  def sub=(bool)
34
- handle_physical_tag('sub',bool)
68
+ handle_physical_tag('sub', bool)
69
+ @sub = bool
70
+ end
71
+
72
+ def sup(bool = nil)
73
+ self.sup = bool if bool
74
+ @sup
35
75
  end
36
76
 
37
77
  def sup=(bool)
38
- handle_physical_tag('sup',bool)
78
+ handle_physical_tag('sup', bool)
79
+ @sup = bool
80
+ end
81
+
82
+ def tt(bool = nil)
83
+ self.tt = bool if bool
84
+ @tt
39
85
  end
40
86
 
41
87
  def tt=(bool)
42
- handle_physical_tag('tt',bool)
88
+ handle_physical_tag('tt', bool)
89
+ @tt = bool
90
+ end
91
+
92
+ def underline(bool = nil)
93
+ self.underline = bool if bool
94
+ @bool
43
95
  end
44
96
 
45
97
  def underline=(bool)
46
- handle_physical_tag('u',bool)
98
+ handle_physical_tag('u', bool)
99
+ @bool = bool
47
100
  end
48
101
 
49
- def handle_physical_tag(tag,bool)
102
+ private
103
+
104
+ def handle_physical_tag(tag, bool)
50
105
  begin_tag = "<#{tag}>"
51
106
  end_tag = "</#{tag}>"
52
- unless bool == true || bool == false
53
- msg = "Invalid tag value: #{bool}"
54
- raise ArgumentError, msg
55
- end
56
- if bool == true
57
- @html_body = begin_tag + @html_body + end_tag
107
+
108
+ if bool
109
+ self.replace(begin_tag << self << end_tag)
58
110
  else
59
- @html_body.gsub!(/#{begin_tag}|#{end_tag}/,'')
111
+ self.replace(self.gsub(/#{begin_tag}|#{end_tag}/,''))
60
112
  end
61
- @html_body
62
113
  end
63
-
64
- end
114
+ end
@@ -6,143 +6,150 @@
6
6
  ############################################################################
7
7
  base = File.basename(Dir.pwd)
8
8
 
9
- if base == "test" || base =~ /html-table/
10
- Dir.chdir("..") if base == "test"
9
+ if base == 'test' || base =~ /html-table/
10
+ Dir.chdir('..') if base == 'test'
11
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
12
+ $LOAD_PATH.unshift(Dir.pwd + '/lib')
13
+ $LOAD_PATH.unshift(Dir.pwd + '/lib/html')
14
+ Dir.chdir('test') rescue nil
15
15
  end
16
16
 
17
- require "test/unit"
18
- require "html/table"
17
+ require 'test/unit'
18
+ require 'html/table'
19
19
  include HTML
20
20
 
21
21
  class TC_AttributeHandler < Test::Unit::TestCase
22
22
  def setup
23
- @t = Table.new(["foo",1,"bar"])
23
+ @table = Table.new(['foo',1,'bar'])
24
24
  end
25
25
 
26
26
  def test_abbr
27
- assert_respond_to(@t,:abbr)
28
- assert_respond_to(@t,:abbr=)
29
- assert_nothing_raised{ @t.abbr }
30
- assert_nothing_raised{ @t.abbr="foo" }
27
+ assert_respond_to(@table, :abbr)
28
+ assert_respond_to(@table, :abbr=)
29
+ assert_nothing_raised{ @table.abbr }
30
+ assert_nothing_raised{ @table.abbr = 'foo' }
31
31
  end
32
32
 
33
33
  def test_align
34
- assert_respond_to(@t,:align)
35
- assert_respond_to(@t,:align=)
36
- assert_nothing_raised{ @t.align }
37
- assert_nothing_raised{ @t.align = "center" }
38
- assert_raises(ArgumentError){ @t.align = "foo" }
34
+ assert_respond_to(@table, :align)
35
+ assert_respond_to(@table, :align=)
36
+ assert_nothing_raised{ @table.align }
37
+ assert_nothing_raised{ @table.align = 'center' }
38
+ assert_raises(ArgumentError){ @table.align = 'foo' }
39
39
  end
40
40
 
41
41
  def test_axis
42
- assert_respond_to(@t,:axis)
43
- assert_respond_to(@t,:axis=)
44
- assert_nothing_raised{ @t.axis }
45
- assert_nothing_raised{ @t.axis="foo" }
42
+ assert_respond_to(@table, :axis)
43
+ assert_respond_to(@table, :axis=)
44
+ assert_nothing_raised{ @table.axis }
45
+ assert_nothing_raised{ @table.axis = 'foo' }
46
46
  end
47
47
 
48
48
  def test_background
49
- assert_respond_to(@t,:background)
50
- assert_respond_to(@t,:background=)
51
- assert_nothing_raised{ @t.background }
52
- assert_nothing_raised{ @t.background="foo" }
53
- assert_raises(TypeError){ @t.background = 1 }
49
+ assert_respond_to(@table, :background)
50
+ assert_respond_to(@table, :background=)
51
+ assert_nothing_raised{ @table.background }
52
+ assert_nothing_raised{ @table.background = 'foo' }
53
+ assert_raises(TypeError){ @table.background = 1 }
54
54
  end
55
55
 
56
56
  def test_bgcolor
57
- assert_respond_to(@t,:bgcolor)
58
- assert_respond_to(@t,:bgcolor=)
59
- assert_nothing_raised{ @t.bgcolor }
60
- assert_nothing_raised{ @t.bgcolor="foo" }
57
+ assert_respond_to(@table, :bgcolor)
58
+ assert_respond_to(@table, :bgcolor=)
59
+ assert_nothing_raised{ @table.bgcolor }
60
+ assert_nothing_raised{ @table.bgcolor = 'foo' }
61
61
  end
62
62
 
63
63
  def test_border
64
- assert_respond_to(@t,:border)
65
- assert_respond_to(@t,:border=)
66
- assert_nothing_raised{ @t.border }
67
- assert_nothing_raised{ @t.border = 2 }
68
- assert_nothing_raised{ @t.border = true }
69
- assert_nothing_raised{ @t.border = false }
64
+ assert_respond_to(@table, :border)
65
+ assert_respond_to(@table, :border=)
66
+ assert_nothing_raised{ @table.border }
67
+ assert_nothing_raised{ @table.border = 2 }
68
+ assert_nothing_raised{ @table.border = true }
69
+ assert_nothing_raised{ @table.border = false }
70
70
  end
71
71
 
72
72
  def test_bordercolor
73
- assert_respond_to(@t,:bordercolor)
74
- assert_respond_to(@t,:bordercolor=)
75
- assert_nothing_raised{ @t.bordercolor }
76
- assert_nothing_raised{ @t.bordercolor="foo" }
73
+ assert_respond_to(@table, :bordercolor)
74
+ assert_respond_to(@table, :bordercolor=)
75
+ assert_nothing_raised{ @table.bordercolor }
76
+ assert_nothing_raised{ @table.bordercolor = 'foo' }
77
77
  end
78
78
 
79
79
  def test_bordercolordark
80
- assert_respond_to(@t,:bordercolordark)
81
- assert_respond_to(@t,:bordercolordark=)
82
- assert_nothing_raised{ @t.bordercolordark }
83
- assert_nothing_raised{ @t.bordercolordark="foo" }
80
+ assert_respond_to(@table, :bordercolordark)
81
+ assert_respond_to(@table, :bordercolordark=)
82
+ assert_nothing_raised{ @table.bordercolordark }
83
+ assert_nothing_raised{ @table.bordercolordark = 'foo' }
84
84
  end
85
85
 
86
86
  def test_bordercolorlight
87
- assert_respond_to(@t,:bordercolorlight)
88
- assert_respond_to(@t,:bordercolorlight=)
89
- assert_nothing_raised{ @t.bordercolorlight }
90
- assert_nothing_raised{ @t.bordercolorlight="foo" }
87
+ assert_respond_to(@table, :bordercolorlight)
88
+ assert_respond_to(@table, :bordercolorlight=)
89
+ assert_nothing_raised{ @table.bordercolorlight }
90
+ assert_nothing_raised{ @table.bordercolorlight = 'foo' }
91
91
  end
92
92
 
93
93
  def test_cellpadding
94
- assert_respond_to(@t,:cellpadding)
95
- assert_respond_to(@t,:cellpadding=)
96
- assert_nothing_raised{ @t.cellpadding }
97
- assert_nothing_raised{ @t.cellpadding=1 }
98
- assert_raises(ArgumentError){ @t.cellpadding = -1 }
94
+ assert_respond_to(@table, :cellpadding)
95
+ assert_respond_to(@table, :cellpadding=)
96
+ assert_nothing_raised{ @table.cellpadding }
97
+ assert_nothing_raised{ @table.cellpadding = 1 }
98
+ assert_raises(ArgumentError){ @table.cellpadding = -1 }
99
99
  end
100
100
 
101
101
  def test_cellspacing
102
- assert_respond_to(@t,:cellspacing)
103
- assert_respond_to(@t,:cellspacing=)
104
- assert_nothing_raised{ @t.cellspacing }
105
- assert_nothing_raised{ @t.cellspacing=1 }
106
- assert_raises(ArgumentError){ @t.cellspacing = -1 }
102
+ assert_respond_to(@table, :cellspacing)
103
+ assert_respond_to(@table, :cellspacing=)
104
+ assert_nothing_raised{ @table.cellspacing }
105
+ assert_nothing_raised{ @table.cellspacing = 1 }
106
+ assert_raises(ArgumentError){ @table.cellspacing = -1 }
107
107
  end
108
108
 
109
109
  def test_char
110
- assert_respond_to(@t,:char)
111
- assert_respond_to(@t,:char=)
112
- assert_nothing_raised{ @t.char }
113
- assert_nothing_raised{ @t.char="x" }
114
- assert_raises(ArgumentError){ @t.char = "xx" }
110
+ assert_respond_to(@table, :char)
111
+ assert_respond_to(@table, :char=)
112
+ assert_nothing_raised{ @table.char }
113
+ assert_nothing_raised{ @table.char = 'x' }
114
+ assert_raises(ArgumentError){ @table.char = 'xx' }
115
115
  end
116
116
 
117
117
  def test_charoff
118
- assert_respond_to(@t,:charoff)
119
- assert_respond_to(@t,:charoff=)
120
- assert_nothing_raised{ @t.charoff }
121
- assert_nothing_raised{ @t.charoff=1 }
122
- assert_raises(ArgumentError){ @t.charoff = -1 }
118
+ assert_respond_to(@table, :charoff)
119
+ assert_respond_to(@table, :charoff=)
120
+ assert_nothing_raised{ @table.charoff }
121
+ assert_nothing_raised{ @table.charoff = 1 }
122
+ assert_raises(ArgumentError){ @table.charoff = -1 }
123
+ end
124
+
125
+ def test_class
126
+ assert_respond_to(@table, :class_)
127
+ assert_respond_to(@table, :class_=)
128
+ assert_nothing_raised{ @table.class_ }
129
+ assert_nothing_raised{ @table.class_ = 'myclass' }
123
130
  end
124
131
 
125
132
  def test_col
126
- assert_respond_to(@t,:col)
127
- assert_respond_to(@t,:col=)
128
- assert_nothing_raised{ @t.col }
129
- assert_nothing_raised{ @t.col=1 }
130
- assert_raises(ArgumentError){ @t.col = -1 }
133
+ assert_respond_to(@table, :col)
134
+ assert_respond_to(@table, :col=)
135
+ assert_nothing_raised{ @table.col }
136
+ assert_nothing_raised{ @table.col = 1 }
137
+ assert_raises(ArgumentError){ @table.col = -1 }
131
138
  end
132
139
 
133
140
  def test_colspan
134
- assert_respond_to(@t,:colspan)
135
- assert_respond_to(@t,:colspan=)
136
- assert_nothing_raised{ @t.colspan }
137
- assert_nothing_raised{ @t.colspan=1 }
138
- assert_raises(ArgumentError){ @t.colspan = -1 }
141
+ assert_respond_to(@table, :colspan)
142
+ assert_respond_to(@table, :colspan=)
143
+ assert_nothing_raised{ @table.colspan }
144
+ assert_nothing_raised{ @table.colspan = 1 }
145
+ assert_raises(ArgumentError){ @table.colspan = -1 }
139
146
  end
140
147
 
141
148
  def test_configure
142
- assert_respond_to(@t,:configure)
143
- assert_nothing_raised{ @t.configure(0){} }
144
- assert_nothing_raised{ @t.configure(0,0){} }
145
- assert_raises(ArgumentError){ @t.configure(0,0,0){} }
149
+ assert_respond_to(@table, :configure)
150
+ assert_nothing_raised{ @table.configure(0){} }
151
+ assert_nothing_raised{ @table.configure(0,0){} }
152
+ assert_raises(ArgumentError){ @table.configure(0,0,0){} }
146
153
  end
147
154
 
148
155
  ########################################################################
@@ -150,110 +157,117 @@ class TC_AttributeHandler < Test::Unit::TestCase
150
157
  # type that we want to add as content.
151
158
  ########################################################################
152
159
  def test_content
153
- assert_respond_to(@t,:content)
154
- assert_respond_to(@t,:content=)
155
- assert_nothing_raised{ @t.content = "foo" }
156
- assert_nothing_raised{ @t.content = 123 }
157
- assert_nothing_raised{ @t.content = ["one",2,"three"] }
158
- assert_nothing_raised{ @t.content = [["foo","bar"],[1,2,3]] }
159
- assert_nothing_raised{ @t.content = Table::Row.new }
160
- assert_nothing_raised{ @t.content = Table::Row::Data.new }
161
- assert_nothing_raised{ @t.content = Table::Row::Header.new }
162
- assert_nothing_raised{ @t.content = Table::Head.create }
163
- assert_nothing_raised{ @t.content = Table::Foot.create }
164
- assert_nothing_raised{ @t.content = Table::Body.new }
160
+ assert_respond_to(@table, :content)
161
+ assert_respond_to(@table, :content=)
162
+ assert_nothing_raised{ @table.content = 'foo' }
163
+ assert_nothing_raised{ @table.content = 123 }
164
+ assert_nothing_raised{ @table.content = ['one',2,'three'] }
165
+ assert_nothing_raised{ @table.content = [['foo','bar'],[1,2,3]] }
166
+ assert_nothing_raised{ @table.content = Table::Row.new }
167
+ assert_nothing_raised{ @table.content = Table::Row::Data.new }
168
+ assert_nothing_raised{ @table.content = Table::Row::Header.new }
169
+ assert_nothing_raised{ @table.content = Table::Head.create }
170
+ assert_nothing_raised{ @table.content = Table::Foot.create }
171
+ assert_nothing_raised{ @table.content = Table::Body.new }
165
172
  end
166
173
 
167
174
  def test_frame
168
- assert_respond_to(@t,:frame)
169
- assert_respond_to(@t,:frame=)
170
- assert_nothing_raised{ @t.frame }
171
- assert_nothing_raised{ @t.frame="below" }
172
- assert_raises(ArgumentError){ @t.frame = "foo" }
175
+ assert_respond_to(@table, :frame)
176
+ assert_respond_to(@table, :frame=)
177
+ assert_nothing_raised{ @table.frame }
178
+ assert_nothing_raised{ @table.frame = 'below' }
179
+ assert_raises(ArgumentError){ @table.frame = 'foo' }
173
180
  end
174
181
 
175
182
  def test_height
176
- assert_respond_to(@t,:height)
177
- assert_respond_to(@t,:height=)
178
- assert_nothing_raised{ @t.height }
179
- assert_nothing_raised{ @t.height=1 }
180
- assert_raises(ArgumentError){ @t.height = -1 }
183
+ assert_respond_to(@table, :height)
184
+ assert_respond_to(@table, :height=)
185
+ assert_nothing_raised{ @table.height }
186
+ assert_nothing_raised{ @table.height = 1 }
187
+ assert_raises(ArgumentError){ @table.height = -1 }
181
188
  end
182
189
 
183
190
  def test_hspace
184
- assert_respond_to(@t,:hspace)
185
- assert_respond_to(@t,:hspace=)
186
- assert_nothing_raised{ @t.hspace }
187
- assert_nothing_raised{ @t.hspace=1 }
188
- assert_raises(ArgumentError){ @t.hspace = -1 }
191
+ assert_respond_to(@table, :hspace)
192
+ assert_respond_to(@table, :hspace=)
193
+ assert_nothing_raised{ @table.hspace }
194
+ assert_nothing_raised{ @table.hspace = 1 }
195
+ assert_raises(ArgumentError){ @table.hspace = -1 }
189
196
  end
190
197
 
191
198
  def test_nowrap
192
- assert_respond_to(@t,:nowrap)
193
- assert_respond_to(@t,:nowrap=)
194
- assert_nothing_raised{ @t.nowrap }
195
- assert_nothing_raised{ @t.nowrap=false }
196
- assert_raises(TypeError){ @t.nowrap = "foo" }
199
+ assert_respond_to(@table, :nowrap)
200
+ assert_respond_to(@table, :nowrap=)
201
+ assert_nothing_raised{ @table.nowrap }
202
+ assert_nothing_raised{ @table.nowrap = false }
203
+ assert_raises(TypeError){ @table.nowrap = 'foo' }
197
204
  end
198
205
 
199
206
  def test_rowspan
200
- assert_respond_to(@t,:rowspan)
201
- assert_respond_to(@t,:rowspan=)
202
- assert_nothing_raised{ @t.rowspan }
203
- assert_nothing_raised{ @t.rowspan=1 }
204
- assert_raises(ArgumentError){ @t.rowspan = -1 }
207
+ assert_respond_to(@table, :rowspan)
208
+ assert_respond_to(@table, :rowspan=)
209
+ assert_nothing_raised{ @table.rowspan }
210
+ assert_nothing_raised{ @table.rowspan = 1 }
211
+ assert_raises(ArgumentError){ @table.rowspan = -1 }
205
212
  end
206
213
 
207
214
  def test_rules
208
- assert_respond_to(@t,:rules)
209
- assert_respond_to(@t,:rules=)
210
- assert_nothing_raised{ @t.rules}
211
- assert_nothing_raised{ @t.rules="all" }
212
- assert_raises(ArgumentError){ @t.rules = "foo" }
215
+ assert_respond_to(@table, :rules)
216
+ assert_respond_to(@table, :rules=)
217
+ assert_nothing_raised{ @table.rules }
218
+ assert_nothing_raised{ @table.rules = 'all' }
219
+ assert_raises(ArgumentError){ @table.rules = 'foo' }
213
220
  end
214
221
 
215
222
  def test_span
216
- assert_respond_to(@t,:span)
217
- assert_respond_to(@t,:span=)
218
- assert_nothing_raised{ @t.span }
219
- assert_nothing_raised{ @t.span=1 }
220
- assert_raises(ArgumentError){ @t.span = -1 }
223
+ assert_respond_to(@table, :span)
224
+ assert_respond_to(@table, :span=)
225
+ assert_nothing_raised{ @table.span }
226
+ assert_nothing_raised{ @table.span = 1 }
227
+ assert_raises(ArgumentError){ @table.span = -1 }
228
+ end
229
+
230
+ def test_style
231
+ assert_respond_to(@table, :style)
232
+ assert_respond_to(@table, :style=)
233
+ assert_nothing_raised{ @table.style }
234
+ assert_nothing_raised{ @table.style = 'color: blue' }
221
235
  end
222
236
 
223
237
  def test_summary
224
- assert_respond_to(@t,:summary)
225
- assert_respond_to(@t,:summary=)
226
- assert_nothing_raised{ @t.summary }
227
- assert_nothing_raised{ @t.summary="foo" }
228
- assert_nothing_raised{ @t.summary=1 }
238
+ assert_respond_to(@table, :summary)
239
+ assert_respond_to(@table, :summary=)
240
+ assert_nothing_raised{ @table.summary }
241
+ assert_nothing_raised{ @table.summary = 'foo' }
242
+ assert_nothing_raised{ @table.summary = 1 }
229
243
  end
230
244
 
231
245
  def test_valign
232
- assert_respond_to(@t,:valign)
233
- assert_respond_to(@t,:valign=)
234
- assert_nothing_raised{ @t.valign }
235
- assert_nothing_raised{ @t.valign="center" }
236
- assert_raises(ArgumentError){ @t.valign="foo" }
246
+ assert_respond_to(@table, :valign)
247
+ assert_respond_to(@table, :valign=)
248
+ assert_nothing_raised{ @table.valign }
249
+ assert_nothing_raised{ @table.valign = 'center' }
250
+ assert_raises(ArgumentError){ @table.valign = 'foo' }
237
251
  end
238
252
 
239
253
  def test_vspace
240
- assert_respond_to(@t,:vspace)
241
- assert_respond_to(@t,:vspace=)
242
- assert_nothing_raised{ @t.vspace }
243
- assert_nothing_raised{ @t.vspace=1 }
244
- assert_raises(ArgumentError){ @t.vspace = -1 }
254
+ assert_respond_to(@table, :vspace)
255
+ assert_respond_to(@table, :vspace=)
256
+ assert_nothing_raised{ @table.vspace }
257
+ assert_nothing_raised{ @table.vspace = 1 }
258
+ assert_raises(ArgumentError){ @table.vspace = -1 }
245
259
  end
246
260
 
247
261
  def test_width
248
- assert_respond_to(@t,:width)
249
- assert_respond_to(@t,:width=)
250
- assert_nothing_raised{ @t.width}
251
- assert_nothing_raised{ @t.width = 10 }
252
- assert_nothing_raised{ @t.width = "5%" }
253
- assert_raises(ArgumentError){ @t.width = -1 }
262
+ assert_respond_to(@table, :width)
263
+ assert_respond_to(@table, :width=)
264
+ assert_nothing_raised{ @table.width}
265
+ assert_nothing_raised{ @table.width = 10 }
266
+ assert_nothing_raised{ @table.width = '5%' }
267
+ assert_raises(ArgumentError){ @table.width = -1 }
254
268
  end
255
269
 
256
270
  def teardown
257
- @t = nil
271
+ @table = nil
258
272
  end
259
273
  end