html-table 1.6.3 → 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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8d163a5d1ed51f09edd89fa52b1be03867e99fd3ed2c821662ec5372c6a39e79
4
- data.tar.gz: 65b64e9f3b709f64a3ef03cd32b3d2e19a8c1ad9e149d9f493c03135c5add4c8
3
+ metadata.gz: f8c1474767e4e76fd82d8e8dcaa3491d27a534ffc0579fde0ec2c5937ff65a94
4
+ data.tar.gz: 2d430751276ec4ba09da083f4717dea9a67b8681d9723925ab365ee0a49bc966
5
5
  SHA512:
6
- metadata.gz: 429674c5654f974992d1b3765c5cef42aefce6c2efe6ac2710c480e1d38b81483102967ab0ad5097584522dc62aab0ea625c2309c5f16f69f97bcd34c2b419af
7
- data.tar.gz: 970fe5287e0a4310125237ed62d7ab7bb4e652ebbb129131b88e99975a6cae0eefd46fd03374463df3e8d64d64eecf5ac3cb09728ee1ad6c3d68104f0673ffba
6
+ metadata.gz: 3de452df4f98b15f7be7acb6dedd1a2bc8df8e6e3993740c3e84d292355978fb4db2ec8a251a5aca6bcca795084af9baaed9fa37805e9e26ae6142e8b09c5cf1
7
+ data.tar.gz: 313c1242ece38004aa7090695beb6d125b0ee17b968eb902a4321cd7926bec0bfc3c488c698a297b957af250c726b7ad6d7790795719d65a0d5c15224dfb17f0
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -1,3 +1,7 @@
1
+ == 1.7.0 - 8-Sep-2020
2
+ * Switched from test-unit to rspec.
3
+ * Added a Gemfile.
4
+
1
5
  == 1.6.3 - 18-Mar-2020
2
6
  * Fixed the LICENSE file, which inadvertently included some unrelated
3
7
  copyright notices. I also removed some unnecessary boilerplate.
data/Gemfile ADDED
@@ -0,0 +1,7 @@
1
+ source 'https://rubygems.org' do
2
+ gem 'rake'
3
+ gem 'structured_warnings', '~> 0.4.0'
4
+ group 'test' do
5
+ gem 'rspec', '~> 3.9'
6
+ end
7
+ end
@@ -2,6 +2,7 @@
2
2
  * LICENSE
3
3
  * MANIFEST
4
4
  * README
5
+ * Gemfile
5
6
  * Rakefile
6
7
  * html-table.gemspec
7
8
  * certs/djberg96_pub.pem
@@ -25,8 +26,6 @@
25
26
  * doc/examples/simple2.rb
26
27
  * doc/examples/simple3.rb
27
28
  * lib/html-table.rb
28
- * lib/strongtyping.rb
29
- * lib/html/attribute_handler.rb
30
29
  * lib/html/body.rb
31
30
  * lib/html/caption.rb
32
31
  * lib/html/col.rb
@@ -36,21 +35,23 @@
36
35
  * lib/html/foot.rb
37
36
  * lib/html/head.rb
38
37
  * lib/html/header.rb
39
- * lib/html/html_handler.rb
40
38
  * lib/html/row.rb
41
39
  * lib/html/table.rb
42
40
  * lib/html/tablesection.rb
43
- * lib/html/tag_handler.rb
44
- * test/test_attribute_handler.rb
45
- * test/test_body.rb
46
- * test/test_caption.rb
47
- * test/test_col.rb
48
- * test/test_colgroup.rb
49
- * test/test_data.rb
50
- * test/test_head.rb
51
- * test/test_header.rb
52
- * test/test_html_handler.rb
53
- * test/test_row.rb
54
- * test/test_table.rb
55
- * test/test_tablesection.rb
56
- * test/test_tag_handler.rb
41
+ * lib/html/mixin/attribute_handler.rb
42
+ * lib/html/mixin/html_handler.rb
43
+ * lib/html/mixin/strongtyping.rb
44
+ * lib/html/mixin/tag_handler.rb
45
+ * spec/attribute_handler_spec.rb
46
+ * spec/body_spec.rb
47
+ * spec/caption_spec.rb
48
+ * spec/col_spec.rb
49
+ * spec/colgroup_col_spec.rb
50
+ * spec/data_spec.rb
51
+ * spec/head_spec.rb
52
+ * spec/header_spec.rb
53
+ * spec/html_handler_spec.rb
54
+ * spec/row_spec.rb
55
+ * spec/table_spec.rb
56
+ * spec/tablesection_spec.rb
57
+ * spec/tag_handler_spec.rb
data/Rakefile CHANGED
@@ -1,146 +1,117 @@
1
- require 'rake'
2
- require 'rake/clean'
3
- require 'rake/testtask'
4
-
5
- CLEAN.include("**/*.gem", "**/*.rbc")
6
-
7
- namespace :gem do
8
- desc 'Build the html-table gem'
9
- task :create => [:clean] do
10
- require 'rubygems/package'
11
- spec = eval(IO.read('html-table.gemspec'))
12
- spec.signing_key = File.join(Dir.home, '.ssh', 'gem-private_key.pem')
13
- Gem::Package.build(spec, true)
14
- end
15
-
16
- desc "Install the html-table package as a gem"
17
- task :install => [:create] do
18
- file = Dir["*.gem"].first
19
- sh "gem install -l #{file}"
20
- end
21
- end
22
-
23
- namespace 'example' do
24
- desc "Run the first simple html-table example"
25
- task :simple1 do
26
- sh 'ruby -Ilib examples/simple1.rb'
27
- end
28
-
29
- desc "Run the second simple html-table example"
30
- task :simple2 do
31
- sh 'ruby -Ilib examples/simple2.rb'
32
- end
33
-
34
- desc "Run the third simple html-table example"
35
- task :simple3 do
36
- sh 'ruby -Ilib examples/simple3.rb'
37
- end
38
-
39
- desc "Run the first intermediate html-table example"
40
- task :intermediate1 do
41
- sh 'ruby -Ilib examples/intermediate1.rb'
42
- end
43
-
44
- desc "Run the second intermediate html-table example"
45
- task :intermediate2 do
46
- sh 'ruby -Ilib examples/intermediate2.rb'
47
- end
48
-
49
- desc "Run the advanced html-table example"
50
- task :advanced do
51
- sh 'ruby -Ilib examples/advanced.rb'
52
- end
53
- end
54
-
55
- Rake::TestTask.new do |t|
56
- t.warning = true
57
- t.verbose = true
58
- end
59
-
60
- namespace 'test' do
61
- Rake::TestTask.new('attribute_handler') do |t|
62
- t.warning = true
63
- t.verbose = true
64
- t.test_files = FileList['test/test_attribute_handler.rb']
65
- end
66
-
67
- Rake::TestTask.new('body') do |t|
68
- t.warning = true
69
- t.verbose = true
70
- t.test_files = FileList['test/test_body.rb']
71
- end
72
-
73
- Rake::TestTask.new('caption') do |t|
74
- t.warning = true
75
- t.verbose = true
76
- t.test_files = FileList['test/test_caption.rb']
77
- end
78
-
79
- Rake::TestTask.new('col') do |t|
80
- t.warning = true
81
- t.verbose = true
82
- t.test_files = FileList['test/test_col.rb']
83
- end
84
-
85
- Rake::TestTask.new('colgroup') do |t|
86
- t.warning = true
87
- t.verbose = true
88
- t.test_files = FileList['test/test_colgroup.rb']
89
- end
90
-
91
- Rake::TestTask.new('data') do |t|
92
- t.warning = true
93
- t.verbose = true
94
- t.test_files = FileList['test/test_data.rb']
95
- end
96
-
97
- Rake::TestTask.new('foot') do |t|
98
- t.warning = true
99
- t.verbose = true
100
- t.test_files = FileList['test/test_foot.rb']
101
- end
102
-
103
- Rake::TestTask.new('head') do |t|
104
- t.warning = true
105
- t.verbose = true
106
- t.test_files = FileList['test/test_head.rb']
107
- end
108
-
109
- Rake::TestTask.new('header') do |t|
110
- t.warning = true
111
- t.verbose = true
112
- t.test_files = FileList['test/test_header.rb']
113
- end
114
-
115
- Rake::TestTask.new('html_handler') do |t|
116
- t.warning = true
117
- t.verbose = true
118
- t.test_files = FileList['test/test_html_handler.rb']
119
- end
120
-
121
- Rake::TestTask.new('row') do |t|
122
- t.warning = true
123
- t.verbose = true
124
- t.test_files = FileList['test/test_row.rb']
125
- end
126
-
127
- Rake::TestTask.new('table') do |t|
128
- t.warning = true
129
- t.verbose = true
130
- t.test_files = FileList['test/test_table.rb']
131
- end
132
-
133
- Rake::TestTask.new('tablesection') do |t|
134
- t.warning = true
135
- t.verbose = true
136
- t.test_files = FileList['test/test_tablesection.rb']
137
- end
138
-
139
- Rake::TestTask.new('tag_handler') do |t|
140
- t.warning = true
141
- t.verbose = true
142
- t.test_files = FileList['test/test_tag_handler.rb']
143
- end
144
- end
145
-
146
- task :default => :test
1
+ require 'rake'
2
+ require 'rake/clean'
3
+ require 'rspec/core/rake_task'
4
+
5
+ CLEAN.include("**/*.gem", "**/*.rbc", "**/*.lock")
6
+
7
+ namespace :gem do
8
+ desc 'Build the html-table gem'
9
+ task :create => [:clean] do
10
+ require 'rubygems/package'
11
+ spec = eval(IO.read('html-table.gemspec'))
12
+ spec.signing_key = File.join(Dir.home, '.ssh', 'gem-private_key.pem')
13
+ Gem::Package.build(spec, true)
14
+ end
15
+
16
+ desc "Install the html-table package as a gem"
17
+ task :install => [:create] do
18
+ file = Dir["*.gem"].first
19
+ sh "gem install -l #{file}"
20
+ end
21
+ end
22
+
23
+ namespace 'example' do
24
+ desc "Run the first simple html-table example"
25
+ task :simple1 do
26
+ sh 'ruby -Ilib examples/simple1.rb'
27
+ end
28
+
29
+ desc "Run the second simple html-table example"
30
+ task :simple2 do
31
+ sh 'ruby -Ilib examples/simple2.rb'
32
+ end
33
+
34
+ desc "Run the third simple html-table example"
35
+ task :simple3 do
36
+ sh 'ruby -Ilib examples/simple3.rb'
37
+ end
38
+
39
+ desc "Run the first intermediate html-table example"
40
+ task :intermediate1 do
41
+ sh 'ruby -Ilib examples/intermediate1.rb'
42
+ end
43
+
44
+ desc "Run the second intermediate html-table example"
45
+ task :intermediate2 do
46
+ sh 'ruby -Ilib examples/intermediate2.rb'
47
+ end
48
+
49
+ desc "Run the advanced html-table example"
50
+ task :advanced do
51
+ sh 'ruby -Ilib examples/advanced.rb'
52
+ end
53
+ end
54
+
55
+ namespace :spec do
56
+ RSpec::Core::RakeTask.new(:attribute_handler) do |t|
57
+ t.pattern = 'spec/attribute_handler_spec.rb'
58
+ end
59
+
60
+ RSpec::Core::RakeTask.new(:body) do |t|
61
+ t.pattern = 'spec/body_spec.rb'
62
+ end
63
+
64
+ RSpec::Core::RakeTask.new(:caption) do |t|
65
+ t.pattern = 'spec/caption_spec.rb'
66
+ end
67
+
68
+ RSpec::Core::RakeTask.new(:col) do |t|
69
+ t.pattern = 'spec/col_spec.rb'
70
+ end
71
+
72
+ RSpec::Core::RakeTask.new(:colgroup) do |t|
73
+ t.pattern = 'spec/colgroup_spec.rb'
74
+ end
75
+
76
+ RSpec::Core::RakeTask.new(:data) do |t|
77
+ t.pattern = 'spec/data_spec.rb'
78
+ end
79
+
80
+ RSpec::Core::RakeTask.new(:foot) do |t|
81
+ t.pattern = 'spec/foot_spec.rb'
82
+ end
83
+
84
+ RSpec::Core::RakeTask.new(:head) do |t|
85
+ t.pattern = 'spec/head_spec.rb'
86
+ end
87
+
88
+ RSpec::Core::RakeTask.new(:header) do |t|
89
+ t.pattern = 'spec/header_spec.rb'
90
+ end
91
+
92
+ RSpec::Core::RakeTask.new(:html_handler) do |t|
93
+ t.pattern = 'spec/html_handler_spec.rb'
94
+ end
95
+
96
+ RSpec::Core::RakeTask.new(:row) do |t|
97
+ t.pattern = 'spec/row_spec.rb'
98
+ end
99
+
100
+ RSpec::Core::RakeTask.new(:table) do |t|
101
+ t.pattern = 'spec/table_spec.rb'
102
+ end
103
+
104
+ RSpec::Core::RakeTask.new(:tablesection) do |t|
105
+ t.pattern = 'spec/tablesection_spec.rb'
106
+ end
107
+
108
+ RSpec::Core::RakeTask.new(:tag_handler) do |t|
109
+ t.pattern = 'spec/tag_handler_spec.rb'
110
+ end
111
+
112
+ RSpec::Core::RakeTask.new(:all) do |t|
113
+ t.pattern = 'spec/*_spec.rb'
114
+ end
115
+ end
116
+
117
+ task :default => ['spec:all', :clean]
@@ -2,21 +2,21 @@ require 'rubygems'
2
2
 
3
3
  Gem::Specification.new do |spec|
4
4
  spec.name = 'html-table'
5
- spec.version = '1.6.3'
5
+ spec.version = '1.7.0'
6
6
  spec.author = 'Daniel J. Berger'
7
7
  spec.license = 'Apache-2.0'
8
8
  spec.email = 'djberg96@gmail.com'
9
9
  spec.homepage = 'http://github.com/djberg96/html-table'
10
10
  spec.summary = 'A Ruby interface for generating HTML tables'
11
- spec.test_files = Dir['test/*.rb']
11
+ spec.test_files = Dir['spec/*.rb']
12
12
  spec.files = Dir['**/*'].reject{ |f| f.include?('git') }
13
13
  spec.cert_chain = ['certs/djberg96_pub.pem']
14
14
 
15
15
  spec.extra_rdoc_files = ['README.rdoc', 'CHANGES.rdoc'] + Dir['doc/*.rdoc']
16
16
 
17
- spec.add_dependency('structured_warnings', '~> 0.3.0')
17
+ spec.add_dependency('structured_warnings', '~> 0.4.0')
18
18
 
19
- spec.add_development_dependency('test-unit')
19
+ spec.add_development_dependency('rspec', '~> 3.9')
20
20
  spec.add_development_dependency('rake')
21
21
 
22
22
  spec.metadata = {
@@ -2,7 +2,7 @@
2
2
  # with HTML tables. In some cases validation is done on the setters.
3
3
  #--
4
4
  # The seemingly redundant writer methods were left here for backwards
5
- # compatibility and for those who may not prefer the DSI.
5
+ # compatibility and for those who may not prefer the DSL.
6
6
  #
7
7
  module HTML
8
8
  module Mixin
@@ -394,7 +394,7 @@ module HTML
394
394
  end
395
395
 
396
396
  def width=(num)
397
- if num =~ /%/
397
+ if num.to_s =~ /%/
398
398
  @width = num
399
399
  else
400
400
  raise ArgumentError if num.to_i < 0
@@ -20,7 +20,7 @@ module HTML
20
20
  include HTML::Mixin::HtmlHandler
21
21
 
22
22
  # The version of the html-table library
23
- VERSION = '1.6.3'.freeze
23
+ VERSION = '1.7.0'.freeze
24
24
 
25
25
  # The indentation level for the <table> and </table> tags
26
26
  @indent_level = 0
@@ -0,0 +1,360 @@
1
+ ############################################################################
2
+ # attribute_handler_spec.rb
3
+ #
4
+ # Test suite for the AttributeHandler module. For these tests, we'll use an
5
+ # instance of the Table class where the module has been mixed in.
6
+ ############################################################################
7
+ require 'rspec'
8
+ require 'html/table'
9
+
10
+ RSpec.describe HTML::Mixin::AttributeHandler do
11
+ before(:all) do
12
+ NonStandardExtensionWarning.disable
13
+ end
14
+
15
+ before do
16
+ @table = HTML::Table.new(['foo',1,'bar'])
17
+ end
18
+
19
+ example "abbr_basic" do
20
+ expect(@table).to respond_to(:abbr)
21
+ expect(@table).to respond_to(:abbr=)
22
+ end
23
+
24
+ example "abbr" do
25
+ expect{ @table.abbr }.not_to raise_error
26
+ expect(@table.abbr).to be_nil
27
+ expect{ @table.abbr = 'foo' }.not_to raise_error
28
+ expect( @table.abbr).to eq('foo')
29
+ end
30
+
31
+ example "align_basic" do
32
+ expect(@table).to respond_to(:align)
33
+ expect(@table).to respond_to(:align=)
34
+ end
35
+
36
+ example "align" do
37
+ expect{ @table.align }.not_to raise_error
38
+ expect(@table.align).to be_nil
39
+ expect{ @table.align = 'center' }.not_to raise_error
40
+ expect( @table.align).to eq('center')
41
+ end
42
+
43
+ example "align_expected_errors" do
44
+ expect{ @table.align = 'foo' }.to raise_error(ArgumentError)
45
+ end
46
+
47
+ example "axis" do
48
+ expect(@table).to respond_to(:axis)
49
+ expect(@table).to respond_to(:axis=)
50
+ expect{ @table.axis }.not_to raise_error
51
+ expect{ @table.axis = 'foo' }.not_to raise_error
52
+ end
53
+
54
+ example "background_basic" do
55
+ expect(@table).to respond_to(:background)
56
+ expect(@table).to respond_to(:background=)
57
+ end
58
+
59
+ example "background" do
60
+ expect{ @table.background }.not_to raise_error
61
+ expect(@table.background).to be_nil
62
+ expect{ @table.background = 'foo' }.not_to raise_error
63
+ expect( @table.background).to eq('foo')
64
+ end
65
+
66
+ example "background_expected_errors" do
67
+ expect{ @table.background = 1 }.to raise_error(TypeError)
68
+ end
69
+
70
+ example "bgcolor_basic" do
71
+ expect(@table).to respond_to(:bgcolor)
72
+ expect(@table).to respond_to(:bgcolor=)
73
+ end
74
+
75
+ example "bgcolor" do
76
+ expect{ @table.bgcolor }.not_to raise_error
77
+ expect(@table.bgcolor).to be_nil
78
+ expect{ @table.bgcolor = 'foo' }.not_to raise_error
79
+ expect( @table.bgcolor).to eq('foo')
80
+ end
81
+
82
+ example "border_basic" do
83
+ expect(@table).to respond_to(:border)
84
+ expect(@table).to respond_to(:border=)
85
+ end
86
+
87
+ example "border" do
88
+ expect{ @table.border }.not_to raise_error
89
+ expect{ @table.border = 2 }.not_to raise_error
90
+ expect{ @table.border = true }.not_to raise_error
91
+ expect{ @table.border = false }.not_to raise_error
92
+ end
93
+
94
+ example "bordercolor_basic" do
95
+ expect(@table).to respond_to(:bordercolor)
96
+ expect(@table).to respond_to(:bordercolor=)
97
+ end
98
+
99
+ example "bordercolor" do
100
+ expect{ @table.bordercolor }.not_to raise_error
101
+ expect(@table.bordercolor).to be_nil
102
+ expect{ @table.bordercolor = 'foo' }.not_to raise_error
103
+ expect( @table.bordercolor).to eq('foo')
104
+ end
105
+
106
+ example "bordercolordark_basic" do
107
+ expect(@table).to respond_to(:bordercolordark)
108
+ expect(@table).to respond_to(:bordercolordark=)
109
+ end
110
+
111
+ example "bordercolordark" do
112
+ expect{ @table.bordercolordark }.not_to raise_error
113
+ expect(@table.bordercolordark).to be_nil
114
+ expect{ @table.bordercolordark = 'foo' }.not_to raise_error
115
+ expect( @table.bordercolordark).to eq('foo')
116
+ end
117
+
118
+ example "bordercolorlight" do
119
+ expect(@table).to respond_to(:bordercolorlight)
120
+ expect(@table).to respond_to(:bordercolorlight=)
121
+ expect{ @table.bordercolorlight }.not_to raise_error
122
+ expect{ @table.bordercolorlight = 'foo' }.not_to raise_error
123
+ end
124
+
125
+ example "cellpadding" do
126
+ expect(@table).to respond_to(:cellpadding)
127
+ expect(@table).to respond_to(:cellpadding=)
128
+ expect{ @table.cellpadding }.not_to raise_error
129
+ expect{ @table.cellpadding = 1 }.not_to raise_error
130
+ end
131
+
132
+ example "cellpadding_expected_errors" do
133
+ expect{ @table.cellpadding = -1 }.to raise_error(ArgumentError)
134
+ end
135
+
136
+ example "cellspacing" do
137
+ expect(@table).to respond_to(:cellspacing)
138
+ expect(@table).to respond_to(:cellspacing=)
139
+ expect{ @table.cellspacing }.not_to raise_error
140
+ expect{ @table.cellspacing = 1 }.not_to raise_error
141
+ end
142
+
143
+ example "cellspacing_expected_errors" do
144
+ expect{ @table.cellspacing = -1 }.to raise_error(ArgumentError)
145
+ end
146
+
147
+ example "char" do
148
+ expect(@table).to respond_to(:char)
149
+ expect(@table).to respond_to(:char=)
150
+ expect{ @table.char }.not_to raise_error
151
+ expect{ @table.char = 'x' }.not_to raise_error
152
+ end
153
+
154
+ example "char_expected_errors" do
155
+ expect{ @table.char = 'xx' }.to raise_error(ArgumentError)
156
+ end
157
+
158
+ example "charoff" do
159
+ expect(@table).to respond_to(:charoff)
160
+ expect(@table).to respond_to(:charoff=)
161
+ expect{ @table.charoff }.not_to raise_error
162
+ expect{ @table.charoff = 1 }.not_to raise_error
163
+ end
164
+
165
+ example "charoff_expected_errors" do
166
+ expect{ @table.charoff = -1 }.to raise_error(ArgumentError)
167
+ end
168
+
169
+ example "class" do
170
+ expect(@table).to respond_to(:class_)
171
+ expect(@table).to respond_to(:class_=)
172
+ expect{ @table.class_ }.not_to raise_error
173
+ expect{ @table.class_ = 'myclass' }.not_to raise_error
174
+ end
175
+
176
+ example "col" do
177
+ expect(@table).to respond_to(:col)
178
+ expect(@table).to respond_to(:col=)
179
+ expect{ @table.col }.not_to raise_error
180
+ expect{ @table.col = 1 }.not_to raise_error
181
+ end
182
+
183
+ example "col_expected_errors" do
184
+ expect{ @table.col = -1 }.to raise_error(ArgumentError)
185
+ end
186
+
187
+ example "colspan" do
188
+ expect(@table).to respond_to(:colspan)
189
+ expect(@table).to respond_to(:colspan=)
190
+ expect{ @table.colspan }.not_to raise_error
191
+ expect{ @table.colspan = 1 }.not_to raise_error
192
+ end
193
+
194
+ example "colspan_expected_errors" do
195
+ expect{ @table.colspan = -1 }.to raise_error(ArgumentError)
196
+ end
197
+
198
+ example "configure" do
199
+ expect(@table).to respond_to(:configure)
200
+ expect{ @table.configure(0){}.not_to raise_error }
201
+ expect{ @table.configure(0,0){}.not_to raise_error }
202
+ end
203
+
204
+ example "configure_expected_errors" do
205
+ expect{ @table.configure(0,0,0){}.to raise_error(ArgumentError) }
206
+ end
207
+
208
+ ########################################################################
209
+ # This test could probably be broken out into separate tests for each
210
+ # type that we want to add as content.
211
+ ########################################################################
212
+ example "content" do
213
+ expect(@table).to respond_to(:content)
214
+ expect(@table).to respond_to(:content=)
215
+ expect{ @table.content = 'foo' }.not_to raise_error
216
+ expect{ @table.content = 123 }.not_to raise_error
217
+ expect{ @table.content = ['one',2,'three'] }.not_to raise_error
218
+ expect{ @table.content = [['foo','bar'],[1,2,3]] }.not_to raise_error
219
+ expect{ @table.content = HTML::Table::Row.new }.not_to raise_error
220
+ expect{ @table.content = HTML::Table::Row::Data.new }.not_to raise_error
221
+ expect{ @table.content = HTML::Table::Row::Header.new }.not_to raise_error
222
+ expect{ @table.content = HTML::Table::Head.create }.not_to raise_error
223
+ expect{ @table.content = HTML::Table::Foot.create }.not_to raise_error
224
+ expect{ @table.content = HTML::Table::Body.new }.not_to raise_error
225
+ end
226
+
227
+ example "frame" do
228
+ expect(@table).to respond_to(:frame)
229
+ expect(@table).to respond_to(:frame=)
230
+ expect{ @table.frame }.not_to raise_error
231
+ expect{ @table.frame = 'below' }.not_to raise_error
232
+ end
233
+
234
+ example "frame_expected_errors" do
235
+ expect{ @table.frame = 'foo' }.to raise_error(ArgumentError)
236
+ end
237
+
238
+ example "height" do
239
+ expect(@table).to respond_to(:height)
240
+ expect(@table).to respond_to(:height=)
241
+ expect{ @table.height }.not_to raise_error
242
+ expect{ @table.height = 1 }.not_to raise_error
243
+ end
244
+
245
+ example "height_expected_errors" do
246
+ expect{ @table.height = -1 }.to raise_error(ArgumentError)
247
+ end
248
+
249
+ example "hspace" do
250
+ expect(@table).to respond_to(:hspace)
251
+ expect(@table).to respond_to(:hspace=)
252
+ expect{ @table.hspace }.not_to raise_error
253
+ expect{ @table.hspace = 1 }.not_to raise_error
254
+ end
255
+
256
+ example "hspace_expected_errors" do
257
+ expect{ @table.hspace = -1 }.to raise_error(ArgumentError)
258
+ end
259
+
260
+ example "nowrap" do
261
+ expect(@table).to respond_to(:nowrap)
262
+ expect(@table).to respond_to(:nowrap=)
263
+ expect{ @table.nowrap }.not_to raise_error
264
+ expect{ @table.nowrap = false }.not_to raise_error
265
+ end
266
+
267
+ example "nowrap_expected_errors" do
268
+ expect{ @table.nowrap = 'foo' }.to raise_error(TypeError)
269
+ end
270
+
271
+ example "rowspan" do
272
+ expect(@table).to respond_to(:rowspan)
273
+ expect(@table).to respond_to(:rowspan=)
274
+ expect{ @table.rowspan }.not_to raise_error
275
+ expect{ @table.rowspan = 1 }.not_to raise_error
276
+ end
277
+
278
+ example "rowspan_expected_errors" do
279
+ expect{ @table.rowspan = -1 }.to raise_error(ArgumentError)
280
+ end
281
+
282
+ example "rules" do
283
+ expect(@table).to respond_to(:rules)
284
+ expect(@table).to respond_to(:rules=)
285
+ expect{ @table.rules }.not_to raise_error
286
+ expect{ @table.rules = 'all' }.not_to raise_error
287
+ end
288
+
289
+ example "rules_expected_errors" do
290
+ expect{ @table.rules = 'foo' }.to raise_error(ArgumentError)
291
+ end
292
+
293
+ example "span" do
294
+ expect(@table).to respond_to(:span)
295
+ expect(@table).to respond_to(:span=)
296
+ expect{ @table.span }.not_to raise_error
297
+ expect{ @table.span = 1 }.not_to raise_error
298
+ end
299
+
300
+ example "span_expected_errors" do
301
+ expect{ @table.span = -1 }.to raise_error(ArgumentError)
302
+ end
303
+
304
+ example "style" do
305
+ expect(@table).to respond_to(:style)
306
+ expect(@table).to respond_to(:style=)
307
+ expect{ @table.style }.not_to raise_error
308
+ expect{ @table.style = 'color: blue' }.not_to raise_error
309
+ end
310
+
311
+ example "summary" do
312
+ expect(@table).to respond_to(:summary)
313
+ expect(@table).to respond_to(:summary=)
314
+ expect{ @table.summary }.not_to raise_error
315
+ expect{ @table.summary = 'foo' }.not_to raise_error
316
+ expect{ @table.summary = 1 }.not_to raise_error
317
+ end
318
+
319
+ example "valign" do
320
+ expect(@table).to respond_to(:valign)
321
+ expect(@table).to respond_to(:valign=)
322
+ expect{ @table.valign }.not_to raise_error
323
+ expect{ @table.valign = 'center' }.not_to raise_error
324
+ end
325
+
326
+ example "valign_expected_errors" do
327
+ expect{ @table.valign = 'foo' }.to raise_error(ArgumentError)
328
+ end
329
+
330
+ example "vspace" do
331
+ expect(@table).to respond_to(:vspace)
332
+ expect(@table).to respond_to(:vspace=)
333
+ expect{ @table.vspace }.not_to raise_error
334
+ expect{ @table.vspace = 1 }.not_to raise_error
335
+ end
336
+
337
+ example "vspace_expected_errors" do
338
+ expect{ @table.vspace = -1 }.to raise_error(ArgumentError)
339
+ end
340
+
341
+ example "width" do
342
+ expect(@table).to respond_to(:width)
343
+ expect(@table).to respond_to(:width=)
344
+ expect{ @table.width}.not_to raise_error
345
+ expect{ @table.width = 10 }.not_to raise_error
346
+ end
347
+
348
+ example "width_with_percent" do
349
+ expect{ @table.width = '5%' }.not_to raise_error
350
+ expect( @table.width).to eq('5%')
351
+ end
352
+
353
+ example "width_expected_errors" do
354
+ expect{ @table.width = -1 }.to raise_error(ArgumentError)
355
+ end
356
+
357
+ after(:all) do
358
+ NonStandardExtensionWarning.enable
359
+ end
360
+ end