axlsx 1.3.2 → 1.3.3

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.
@@ -162,9 +162,12 @@ class TestCell < Test::Unit::TestCase
162
162
  end
163
163
 
164
164
  def test_u
165
+ @c.type = :string
165
166
  assert_raise(ArgumentError) { @c.u = -1.1 }
166
- assert_nothing_raised { @c.u = false }
167
- assert_equal(@c.u, false)
167
+ assert_nothing_raised { @c.u = :single }
168
+ assert_equal(@c.u, :single)
169
+ doc = Nokogiri::XML(@c.to_xml_string(1,1))
170
+ assert(doc.xpath('//u[@val="single"]'))
168
171
  end
169
172
 
170
173
  def test_i
@@ -187,8 +190,8 @@ class TestCell < Test::Unit::TestCase
187
190
 
188
191
  def test_family
189
192
  assert_raise(ArgumentError) { @c.family = -1.1 }
190
- assert_nothing_raised { @c.family = "Who knows!" }
191
- assert_equal(@c.family, "Who knows!")
193
+ assert_nothing_raised { @c.family = 5 }
194
+ assert_equal(@c.family, 5)
192
195
  end
193
196
 
194
197
  def test_b
@@ -251,6 +254,8 @@ class TestCell < Test::Unit::TestCase
251
254
  end
252
255
 
253
256
  def test_to_xml_string_with_run
257
+ # Actually quite a number of similar run styles
258
+ # but the processing should be the same
254
259
  @c.b = true
255
260
  @c.type = :string
256
261
  @c.value = "a"
@@ -259,6 +264,7 @@ class TestCell < Test::Unit::TestCase
259
264
  c_xml = Nokogiri::XML(@c.to_xml_string(1,1))
260
265
  assert(c_xml.xpath("//b"))
261
266
  end
267
+
262
268
  def test_to_xml_string_formula
263
269
  p = Axlsx::Package.new
264
270
  ws = p.workbook.add_worksheet do |sheet|
@@ -285,6 +291,7 @@ class TestCell < Test::Unit::TestCase
285
291
  sz = @c.send(:font_size)
286
292
  assert_equal(sz, 52)
287
293
  end
294
+
288
295
 
289
296
  def test_cell_with_sz
290
297
  @c.sz = 25
@@ -293,6 +300,7 @@ class TestCell < Test::Unit::TestCase
293
300
  def test_to_xml
294
301
  # TODO This could use some much more stringent testing related to the xml content generated!
295
302
  @ws.add_row [Time.now, Date.today, true, 1, 1.0, "text", "=sum(A1:A2)"]
303
+ @ws.rows.last.cells[5].u = true
296
304
  schema = Nokogiri::XML::Schema(File.open(Axlsx::SML_XSD))
297
305
  doc = Nokogiri::XML(@ws.to_xml_string)
298
306
  errors = []
@@ -12,13 +12,13 @@ class TestRow < Test::Unit::TestCase
12
12
  assert(@row.cells.empty?, "no cells by default")
13
13
  assert_equal(@row.worksheet, @ws, "has a reference to the worksheet")
14
14
  assert_nil(@row.height, "height defaults to nil")
15
- assert(!@row.custom_height?, "no custom height by default")
15
+ assert(!@row.custom_height, "no custom height by default")
16
16
  end
17
17
 
18
18
  def test_initialize_with_fixed_height
19
19
  row = @ws.add_row([1,2,3,4,5], :height=>40)
20
20
  assert_equal(40, row.height)
21
- assert(row.custom_height?)
21
+ assert(row.custom_height)
22
22
  end
23
23
 
24
24
  def test_style
@@ -57,7 +57,7 @@ class TestRow < Test::Unit::TestCase
57
57
 
58
58
  def test_custom_height
59
59
  @row.height = 20
60
- assert(@row.custom_height?)
60
+ assert(@row.custom_height)
61
61
  end
62
62
 
63
63
  def test_height
@@ -111,7 +111,7 @@ class TestRow < Test::Unit::TestCase
111
111
  @row.add_cell 1
112
112
  @row.height = 20
113
113
  r_s_xml = Nokogiri::XML(@row.to_xml_string(0, ''))
114
- assert_equal(r_s_xml.xpath(".//row[@r=1][@ht=20][@customHeight=1]").size, 1)
114
+ assert_equal(r_s_xml.xpath(".//row[@r=1][@ht=20][@customHeight='true']").size, 1)
115
115
  end
116
116
 
117
117
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: axlsx
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.2
4
+ version: 1.3.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-11-05 00:00:00.000000000 Z
12
+ date: 2012-11-08 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: nokogiri
@@ -275,7 +275,6 @@ files:
275
275
  - lib/schema/wml.xsd
276
276
  - lib/schema/xml.xsd
277
277
  - examples/auto_filter.rb
278
- - examples/auto_filter.xlsx
279
278
  - examples/basic_charts.rb
280
279
  - examples/chart_colors.rb
281
280
  - examples/colored_links.rb
@@ -285,27 +284,31 @@ files:
285
284
  - examples/conditional_formatting/scaled_colors.rb
286
285
  - examples/conditional_formatting/stop_and_go.rb
287
286
  - examples/data_validation.rb
287
+ - examples/doc/_index.html
288
+ - examples/doc/class_list.html
289
+ - examples/doc/css/common.css
290
+ - examples/doc/css/full_list.css
291
+ - examples/doc/css/style.css
292
+ - examples/doc/file_list.html
293
+ - examples/doc/frames.html
294
+ - examples/doc/index.html
295
+ - examples/doc/js/app.js
296
+ - examples/doc/js/full_list.js
297
+ - examples/doc/js/jquery.js
298
+ - examples/doc/method_list.html
299
+ - examples/doc/top-level-namespace.html
288
300
  - examples/example.rb
289
- - examples/example.xlsx
290
- - examples/example_streamed.xlsx
291
301
  - examples/extractive.pdf
292
302
  - examples/extractive.rb
293
- - examples/extractive.xlsx
294
303
  - examples/finance.rb
295
- - examples/finance.xlsx
296
- - examples/financial.xlsx
297
304
  - examples/hyperlinks.rb
298
- - examples/hyperlinks.xlsx
299
305
  - examples/image1.gif
300
306
  - examples/image1.jpeg
301
307
  - examples/image1.jpg
302
308
  - examples/image1.png
303
- - examples/no-use_autowidth.xlsx
304
309
  - examples/page_setup.rb
305
- - examples/page_setup.xlsx
306
310
  - examples/sample.png
307
311
  - examples/scraping_html.rb
308
- - examples/shared_strings_example.xlsx
309
312
  - examples/sheet_protection.rb
310
313
  - examples/sheet_view.rb
311
314
  - examples/skydrive/axlsx.csv
@@ -331,9 +334,7 @@ files:
331
334
  - examples/sprk2012/styles.rb
332
335
  - examples/sprk2012/styles.xlsx
333
336
  - examples/styles.rb
334
- - examples/styles.xlsx
335
337
  - examples/two_cell_anchor_image.rb
336
- - examples/where_is_my_color.xlsx
337
338
  - LICENSE
338
339
  - README.md
339
340
  - Rakefile
@@ -460,7 +461,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
460
461
  version: '0'
461
462
  segments:
462
463
  - 0
463
- hash: -3709977559995033
464
+ hash: -1544206805148567481
464
465
  requirements: []
465
466
  rubyforge_project:
466
467
  rubygems_version: 1.8.24
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file