writeexcel 0.6.4 → 0.6.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.
@@ -48,41 +48,46 @@ def test_set_tempdir_with_invalid_dir
48
48
  }
49
49
  end
50
50
 
51
- =begin
52
- #
53
- # Comment out because Workbook#check_sheetname was set to private method.
54
- #
55
51
  def test_check_sheetname
56
- valids = valid_sheetname
57
- invalids = invalid_sheetname
58
52
  worksheet1 = @workbook.add_worksheet # implicit name 'Sheet1'
59
53
  worksheet2 = @workbook.add_worksheet # implicit name 'Sheet2'
60
- worksheet3 = @workbook.add_worksheet 'Sheet3' # implicit name 'Sheet3'
61
- worksheet1 = @workbook.add_worksheet 'Sheetz' # implicit name 'Sheetz'
54
+ worksheet3 = @workbook.add_worksheet 'Sheet3' # explicit name 'Sheet3'
55
+ worksheet4 = @workbook.add_worksheet 'Sheetz' # explicit name 'Sheetz'
62
56
 
63
- valids.each do |test|
57
+ valid_sheetnames.each do |test|
64
58
  target = test[0]
65
59
  sheetname = test[1]
66
60
  caption = test[2]
67
- assert_nothing_raised { @workbook.check_sheetname(sheetname) }
61
+ assert_nothing_raised { @workbook.add_worksheet(sheetname) }
68
62
  end
69
- invalids.each do |test|
63
+
64
+ invalid_sheetnames.each do |test|
70
65
  target = test[0]
71
66
  sheetname = test[1]
72
67
  caption = test[2]
73
68
  assert_raise(RuntimeError, "sheetname: #{sheetname}") {
74
- @workbook.check_sheetname(sheetname)
69
+ @workbook.add_worksheet(sheetname)
75
70
  }
76
71
  end
77
72
  end
78
- =end
73
+
74
+ def test_check_sheetname_utf8_only
75
+ ['Лист 1', 'Лист 2', 'Лист 3'].each do |sheetname|
76
+ assert_nothing_raised { @workbook.add_worksheet(sheetname) }
77
+ end
78
+ end
79
+
80
+ def test_check_unicode_bytes_even
81
+ assert_nothing_raised(RuntimeError){ @workbook.add_worksheet('ab', 1)}
82
+ assert_raise(RuntimeError){ @workbook.add_worksheet('abc', 1)}
83
+ end
79
84
 
80
85
  def test_raise_set_compatibility_after_sheet_creation
81
86
  @workbook.add_worksheet
82
87
  assert_raise(RuntimeError) { @workbook.compatibility_mode }
83
88
  end
84
89
 
85
- def valid_sheetname
90
+ def valid_sheetnames
86
91
  [
87
92
  # Tests for valid names
88
93
  [ 'PASS', nil, 'No worksheet name' ],
@@ -92,7 +97,7 @@ def valid_sheetname
92
97
  ]
93
98
  end
94
99
 
95
- def invalid_sheetname
100
+ def invalid_sheetnames
96
101
  [
97
102
  # Tests for invalid names
98
103
  [ 'FAIL', 'Sheet1', 'Caught duplicate name' ],
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{writeexcel}
8
- s.version = "0.6.4"
8
+ s.version = "0.6.5"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Hideo NAKAMURA"]
12
- s.date = %q{2011-04-15}
12
+ s.date = %q{2011-05-14}
13
13
  s.description = %q{Multiple worksheets can be added to a workbook and formatting can be applied to cells. Text, numbers, formulas, hyperlinks and images can be written to the cells.}
14
14
  s.email = %q{cxn03651@msj.biglobe.ne.jp}
15
15
  s.extra_rdoc_files = [
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: writeexcel
3
3
  version: !ruby/object:Gem::Version
4
- hash: 15
4
+ hash: 13
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 6
9
- - 4
10
- version: 0.6.4
9
+ - 5
10
+ version: 0.6.5
11
11
  platform: ruby
12
12
  authors:
13
13
  - Hideo NAKAMURA
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-04-15 00:00:00 +09:00
18
+ date: 2011-05-14 00:00:00 +09:00
19
19
  default_executable:
20
20
  dependencies: []
21
21