axlsx 1.0.4 → 1.0.5

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.
@@ -0,0 +1,34 @@
1
+ require 'test/unit'
2
+ require 'axlsx.rb'
3
+
4
+ class TestTitle < Test::Unit::TestCase
5
+ def setup
6
+ @p = Axlsx::Package.new
7
+ ws = @p.workbook.add_worksheet
8
+ @row = ws.add_row ["one", 1, Time.now]
9
+ @title = Axlsx::Title.new
10
+ @chart = ws.add_chart Axlsx::Bar3DChart
11
+ end
12
+
13
+ def teardown
14
+ end
15
+
16
+ def test_initialization
17
+ assert(@title.text == "")
18
+ assert(@title.cell == nil)
19
+ end
20
+
21
+ def test_text
22
+ assert_raise(ArgumentError, "text must be a string") { @title.text = 123 }
23
+ @title.cell = @row.cells.first
24
+ @title.text = "bob"
25
+ assert(@title.cell == nil, "setting title with text clears the cell")
26
+ end
27
+
28
+ def test_cell
29
+ assert_raise(ArgumentError, "cell must be a Cell") { @title.cell = "123" }
30
+ @title.cell = @row.cells.first
31
+ assert(@title.text == "one")
32
+ end
33
+
34
+ end
@@ -16,19 +16,21 @@ class TestPackage < Test::Unit::TestCase
16
16
  assert(Axlsx::Package.new.workbook.worksheets.size == 0, 'Workbook should not have sheets by default')
17
17
  end
18
18
 
19
- def test_serialization
20
- fname = 'test_serialization.xlsx'
21
- assert_nothing_raised do
22
- if File.writable?(fname)
23
- z= @package.serialize(fname)
24
- zf = Zip::ZipFile.open(fname)
25
- @package.send(:parts).each{ |part| zf.get_entry(part[:entry]) }
26
- File.delete(fname)
27
- else
28
- puts "Skipping write to disk as write permission is not granted to this user"
29
- end
30
- end
31
- end
19
+ # TODO this test needs better file access validation!
20
+ # as does serialization!
21
+ # def test_serialization
22
+ # fname = 'test_serialization.xlsx'
23
+ # assert_nothing_raised do
24
+ # if File::writable?(fname)
25
+ # z= @package.serialize(fname)
26
+ # zf = Zip::ZipFile.open(fname)
27
+ # @package.send(:parts).each{ |part| zf.get_entry(part[:entry]) }
28
+ # File.delete(fname)
29
+ # else
30
+ # puts "Skipping write to disk as write permission is not granted to this user"
31
+ # end
32
+ # end
33
+ # end
32
34
 
33
35
  def test_validation
34
36
  assert_equal(@package.validate.size, 0, @package.validate)
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: axlsx
3
3
  version: !ruby/object:Gem::Version
4
- hash: 31
4
+ hash: 29
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
8
  - 0
9
- - 4
10
- version: 1.0.4
9
+ - 5
10
+ version: 1.0.5
11
11
  platform: ruby
12
12
  authors:
13
13
  - Randy Morgan
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-11-21 00:00:00 Z
18
+ date: 2011-11-22 00:00:00 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: nokogiri
@@ -109,6 +109,10 @@ files:
109
109
  - lib/axlsx/drawing/drawing.rb~
110
110
  - lib/axlsx/drawing/graphic_frame.rb
111
111
  - lib/axlsx/drawing/graphic_frame.rb~
112
+ - lib/axlsx/drawing/line_3D_chart.rb
113
+ - lib/axlsx/drawing/line_3D_chart.rb~
114
+ - lib/axlsx/drawing/line_series.rb
115
+ - lib/axlsx/drawing/line_series.rb~
112
116
  - lib/axlsx/drawing/marker.rb
113
117
  - lib/axlsx/drawing/marker.rb~
114
118
  - lib/axlsx/drawing/pie_3D_chart.rb
@@ -117,8 +121,12 @@ files:
117
121
  - lib/axlsx/drawing/pie_series.rb~
118
122
  - lib/axlsx/drawing/scaling.rb
119
123
  - lib/axlsx/drawing/scaling.rb~
124
+ - lib/axlsx/drawing/ser_axis.rb
125
+ - lib/axlsx/drawing/ser_axis.rb~
120
126
  - lib/axlsx/drawing/series.rb
121
127
  - lib/axlsx/drawing/series.rb~
128
+ - lib/axlsx/drawing/series_title.rb
129
+ - lib/axlsx/drawing/series_title.rb~
122
130
  - lib/axlsx/drawing/title.rb
123
131
  - lib/axlsx/drawing/title.rb~
124
132
  - lib/axlsx/drawing/two_cell_anchor.rb
@@ -245,6 +253,10 @@ files:
245
253
  - test/drawing/tc_drawing.rb
246
254
  - test/drawing/tc_graphic_frame.rb
247
255
  - test/drawing/tc_graphic_frame.rb~
256
+ - test/drawing/tc_line_3d_chart.rb
257
+ - test/drawing/tc_line_3d_chart.rb~
258
+ - test/drawing/tc_line_series.tc
259
+ - test/drawing/tc_line_series.tc~
248
260
  - test/drawing/tc_marker.rb
249
261
  - test/drawing/tc_marker.rb~
250
262
  - test/drawing/tc_pie_3D_chart.rb
@@ -253,8 +265,12 @@ files:
253
265
  - test/drawing/tc_pie_series.rb~
254
266
  - test/drawing/tc_scaling.rb
255
267
  - test/drawing/tc_scaling.rb~
268
+ - test/drawing/tc_ser_axis.rb
269
+ - test/drawing/tc_ser_axis.rb~
256
270
  - test/drawing/tc_series.rb
257
271
  - test/drawing/tc_series.rb~
272
+ - test/drawing/tc_series_title.rb
273
+ - test/drawing/tc_series_title.rb~
258
274
  - test/drawing/tc_title.rb
259
275
  - test/drawing/tc_title.rb~
260
276
  - test/drawing/tc_two_cell_anchor.rb
@@ -318,10 +334,13 @@ files:
318
334
  - test/workbook/worksheet/tc_row.rb~
319
335
  - test/workbook/worksheet/tc_worksheet.rb
320
336
  - test/workbook/worksheet/tc_worksheet.rb~
337
+ - examples/example.rb
338
+ - examples/example.rb~
339
+ - examples/multi_chart.xlsx
321
340
  - LICENSE
322
341
  - README.md
323
342
  - Rakefile
324
- homepage: https://rubyforge.org/projects/axlsx/
343
+ homepage: https://github.com/randym/axlsx
325
344
  licenses: []
326
345
 
327
346
  post_install_message: