surpass 0.0.6 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/surpass/worksheet.rb +1 -1
- data/lib/surpass.rb +1 -1
- data/out.bin +0 -0
- metadata +3 -263
- data/examples/big-16mb.rb +0 -25
- data/examples/big-random-strings.rb +0 -28
- data/examples/blanks.rb +0 -34
- data/examples/blanks.xls +0 -0
- data/examples/col_width.rb +0 -16
- data/examples/col_width.xls +0 -0
- data/examples/dates.rb +0 -31
- data/examples/dates.xls +0 -0
- data/examples/format.rb +0 -23
- data/examples/format.xls +0 -0
- data/examples/hello-world.rb +0 -9
- data/examples/hello-world.xls +0 -0
- data/examples/image.rb +0 -10
- data/examples/image.xls +0 -0
- data/examples/merged.rb +0 -36
- data/examples/merged.xls +0 -0
- data/examples/merged0.rb +0 -27
- data/examples/merged0.xls +0 -0
- data/examples/merged1.rb +0 -99
- data/examples/merged1.xls +0 -0
- data/examples/num_formats.rb +0 -55
- data/examples/num_formats.xls +0 -0
- data/examples/numbers.rb +0 -24
- data/examples/numbers.xls +0 -0
- data/examples/outline.rb +0 -110
- data/examples/outline.xls +0 -0
- data/examples/panes.rb +0 -48
- data/examples/panes.xls +0 -0
- data/examples/protection.rb +0 -132
- data/examples/protection.xls +0 -0
- data/examples/python.bmp +0 -0
- data/examples/row_styles.rb +0 -16
- data/examples/row_styles.xls +0 -0
- data/examples/row_styles_empty.rb +0 -15
- data/examples/row_styles_empty.xls +0 -0
- data/examples/set_cell_and_range_style.rb +0 -12
- data/examples/set_cell_and_range_style.xls +0 -0
- data/examples/wrapped-text.rb +0 -13
- data/examples/wrapped-text.xls +0 -0
- data/examples/write_arrays.rb +0 -22
- data/examples/write_arrays.xls +0 -0
- data/examples/ws_props.rb +0 -80
- data/spec/biff_record_spec.rb +0 -268
- data/spec/cell_spec.rb +0 -56
- data/spec/data/random-strings.txt +0 -10000
- data/spec/document_spec.rb +0 -168
- data/spec/excel_formula_spec.rb +0 -27
- data/spec/formatting_spec.rb +0 -53
- data/spec/output/cells-rk.xls +0 -0
- data/spec/output/cells.xls +0 -0
- data/spec/output/mini.xls +0 -0
- data/spec/reference/P-0508-0000507647-3280-5298.xls +0 -0
- data/spec/reference/all-cell-styles.bin +0 -0
- data/spec/reference/all-number-formats.bin +0 -0
- data/spec/reference/all-styles.bin +0 -0
- data/spec/reference/mini.xls +0 -0
- data/spec/row_spec.rb +0 -19
- data/spec/spec_helper.rb +0 -10
- data/spec/style_spec.rb +0 -89
- data/spec/surpass_spec.rb +0 -7
- data/spec/utilities_spec.rb +0 -57
- data/spec/workbook_spec.rb +0 -48
- data/spec/worksheet_spec.rb +0 -0
- data/stats/cloc.txt +0 -8
- data/stats/rcov.txt +0 -0
- data/stats/specdoc.txt +0 -158
- data/webby/README.txt +0 -6
- data/webby/Sitefile +0 -43
- data/webby/content/css/pygments.txt +0 -6
- data/webby/content/css/style.css +0 -279
- data/webby/content/examples/autoformat.png +0 -0
- data/webby/content/examples/autoformat.rb +0 -32
- data/webby/content/examples/autoformat.xls +0 -0
- data/webby/content/examples/borders.png +0 -0
- data/webby/content/examples/borders.rb +0 -15
- data/webby/content/examples/borders.xls +0 -0
- data/webby/content/examples/colours.png +0 -0
- data/webby/content/examples/colours.rb +0 -23
- data/webby/content/examples/colours.xls +0 -0
- data/webby/content/examples/data.png +0 -0
- data/webby/content/examples/data.rb +0 -11
- data/webby/content/examples/data.xls +0 -0
- data/webby/content/examples/formatting.png +0 -0
- data/webby/content/examples/formatting.rb +0 -78
- data/webby/content/examples/formatting.xls +0 -0
- data/webby/content/examples/hello-world.png +0 -0
- data/webby/content/examples/hello-world.py +0 -8
- data/webby/content/examples/hello-world.rb +0 -9
- data/webby/content/examples/hello-world.xls +0 -0
- data/webby/content/examples/number-format-string.png +0 -0
- data/webby/content/examples/number-format-string.rb +0 -14
- data/webby/content/examples/number-format-string.xls +0 -0
- data/webby/content/examples/patterns.png +0 -0
- data/webby/content/examples/patterns.rb +0 -26
- data/webby/content/examples/patterns.xls +0 -0
- data/webby/content/examples/show-greens.sh +0 -1
- data/webby/content/examples/surpass-info.sh +0 -1
- data/webby/content/img/Thumbs.db +0 -0
- data/webby/content/img/bg_menu.gif +0 -0
- data/webby/content/img/bg_t.gif +0 -0
- data/webby/content/img/bullet.gif +0 -0
- data/webby/content/img/logo.png +0 -0
- data/webby/content/img/logo_.jpg +0 -0
- data/webby/content/img/top_bg.gif +0 -0
- data/webby/content/img/top_bg_.gif +0 -0
- data/webby/content/index.txt +0 -16
- data/webby/content/installation/index.txt +0 -24
- data/webby/content/source/ExcelFormulaLexer.txt +0 -7
- data/webby/content/source/ExcelFormulaParser.txt +0 -7
- data/webby/content/source/biff_record.txt +0 -7
- data/webby/content/source/bitmap.txt +0 -7
- data/webby/content/source/cell.txt +0 -7
- data/webby/content/source/chart.txt +0 -7
- data/webby/content/source/column.txt +0 -7
- data/webby/content/source/document.txt +0 -7
- data/webby/content/source/excel_formula.txt +0 -7
- data/webby/content/source/excel_magic.txt +0 -7
- data/webby/content/source/formatting.txt +0 -7
- data/webby/content/source/row.txt +0 -7
- data/webby/content/source/style.txt +0 -7
- data/webby/content/source/utilities.txt +0 -7
- data/webby/content/source/workbook.txt +0 -7
- data/webby/content/source/worksheet.txt +0 -7
- data/webby/content/surpass-manual.erb +0 -198
- data/webby/layouts/book.txt +0 -29
- data/webby/layouts/default.txt +0 -27
- data/webby/layouts/two_column.txt +0 -25
- data/webby/layouts/web.txt +0 -66
- data/webby/output/.cairn +0 -0
- data/webby/output/css/blueprint/ie.css +0 -26
- data/webby/output/css/blueprint/plugins/buttons/icons/cross.png +0 -0
- data/webby/output/css/blueprint/plugins/buttons/icons/key.png +0 -0
- data/webby/output/css/blueprint/plugins/buttons/icons/tick.png +0 -0
- data/webby/output/css/blueprint/plugins/buttons/readme.txt +0 -32
- data/webby/output/css/blueprint/plugins/buttons/screen.css +0 -97
- data/webby/output/css/blueprint/plugins/fancy-type/readme.txt +0 -14
- data/webby/output/css/blueprint/plugins/fancy-type/screen.css +0 -71
- data/webby/output/css/blueprint/plugins/link-icons/icons/doc.png +0 -0
- data/webby/output/css/blueprint/plugins/link-icons/icons/email.png +0 -0
- data/webby/output/css/blueprint/plugins/link-icons/icons/external.png +0 -0
- data/webby/output/css/blueprint/plugins/link-icons/icons/feed.png +0 -0
- data/webby/output/css/blueprint/plugins/link-icons/icons/im.png +0 -0
- data/webby/output/css/blueprint/plugins/link-icons/icons/pdf.png +0 -0
- data/webby/output/css/blueprint/plugins/link-icons/icons/visited.png +0 -0
- data/webby/output/css/blueprint/plugins/link-icons/icons/xls.png +0 -0
- data/webby/output/css/blueprint/plugins/link-icons/readme.txt +0 -18
- data/webby/output/css/blueprint/plugins/link-icons/screen.css +0 -40
- data/webby/output/css/blueprint/plugins/rtl/readme.txt +0 -10
- data/webby/output/css/blueprint/plugins/rtl/screen.css +0 -109
- data/webby/output/css/blueprint/print.css +0 -30
- data/webby/output/css/blueprint/screen.css +0 -251
- data/webby/output/css/blueprint/src/forms.css +0 -49
- data/webby/output/css/blueprint/src/grid.css +0 -212
- data/webby/output/css/blueprint/src/grid.png +0 -0
- data/webby/output/css/blueprint/src/ie.css +0 -59
- data/webby/output/css/blueprint/src/print.css +0 -85
- data/webby/output/css/blueprint/src/reset.css +0 -38
- data/webby/output/css/blueprint/src/typography.css +0 -105
- data/webby/output/css/pygments.css +0 -59
- data/webby/output/css/site.css +0 -62
- data/webby/output/css/style.css +0 -279
- data/webby/output/examples/autoformat.png +0 -0
- data/webby/output/examples/autoformat.rb +0 -32
- data/webby/output/examples/autoformat.xls +0 -0
- data/webby/output/examples/borders.png +0 -0
- data/webby/output/examples/borders.rb +0 -15
- data/webby/output/examples/borders.xls +0 -0
- data/webby/output/examples/colours.png +0 -0
- data/webby/output/examples/colours.rb +0 -23
- data/webby/output/examples/colours.xls +0 -0
- data/webby/output/examples/data.png +0 -0
- data/webby/output/examples/data.rb +0 -11
- data/webby/output/examples/data.xls +0 -0
- data/webby/output/examples/formatting.png +0 -0
- data/webby/output/examples/formatting.rb +0 -78
- data/webby/output/examples/formatting.xls +0 -0
- data/webby/output/examples/hello-world.png +0 -0
- data/webby/output/examples/hello-world.py +0 -8
- data/webby/output/examples/hello-world.rb +0 -9
- data/webby/output/examples/hello-world.xls +0 -0
- data/webby/output/examples/number-format-string.png +0 -0
- data/webby/output/examples/number-format-string.rb +0 -14
- data/webby/output/examples/number-format-string.xls +0 -0
- data/webby/output/examples/patterns.png +0 -0
- data/webby/output/examples/patterns.rb +0 -26
- data/webby/output/examples/patterns.xls +0 -0
- data/webby/output/examples/show-greens.sh +0 -1
- data/webby/output/examples/surpass-info.sh +0 -1
- data/webby/output/img/Thumbs.db +0 -0
- data/webby/output/img/bg_menu.gif +0 -0
- data/webby/output/img/bg_t.gif +0 -0
- data/webby/output/img/bullet.gif +0 -0
- data/webby/output/img/logo.png +0 -0
- data/webby/output/img/logo_.jpg +0 -0
- data/webby/output/img/top_bg.gif +0 -0
- data/webby/output/img/top_bg_.gif +0 -0
- data/webby/output/index.html +0 -138
- data/webby/output/installation/index.html +0 -64
- data/webby/output/installation/installation.html +0 -1
- data/webby/output/installation.html +0 -1
- data/webby/output/source/ExcelFormulaLexer.html +0 -981
- data/webby/output/source/ExcelFormulaParser.html +0 -661
- data/webby/output/source/biff_record.html +0 -462
- data/webby/output/source/bitmap.html +0 -277
- data/webby/output/source/cell.html +0 -241
- data/webby/output/source/chart.html +0 -64
- data/webby/output/source/column.html +0 -99
- data/webby/output/source/document.html +0 -465
- data/webby/output/source/excel_formula.html +0 -82
- data/webby/output/source/excel_magic.html +0 -1072
- data/webby/output/source/formatting.html +0 -664
- data/webby/output/source/row.html +0 -169
- data/webby/output/source/style.html +0 -158
- data/webby/output/source/surpass.html +0 -110
- data/webby/output/source/utilities.html +0 -145
- data/webby/output/source/workbook.html +0 -265
- data/webby/output/source/worksheet.html +0 -331
- data/webby/output/surpass-manual-0-0-5.pdf +0 -0
- data/webby/output/surpass-manual.aux +0 -50
- data/webby/output/surpass-manual.log +0 -366
- data/webby/output/surpass-manual.out +0 -20
- data/webby/output/surpass-manual.tex +0 -582
- data/webby/output/surpass-manual.toc +0 -20
- data/webby/rsync-exclude +0 -7
- data/webby/tasks/latex.rake +0 -14
- data/webby/tasks/screenshots.rb +0 -58
- data/webby/templates/article.erb +0 -15
- data/webby/templates/book.erb +0 -16
- data/webby/templates/page.erb +0 -9
data/spec/biff_record_spec.rb
DELETED
@@ -1,268 +0,0 @@
|
|
1
|
-
require File.dirname(__FILE__) + '/spec_helper'
|
2
|
-
|
3
|
-
describe InterfaceHeaderRecord do
|
4
|
-
it "should pack correctly" do
|
5
|
-
b = InterfaceHeaderRecord.new
|
6
|
-
b.to_biff.unpack('M*').should === ["\341\000\002\000\260\004"]
|
7
|
-
end
|
8
|
-
end
|
9
|
-
|
10
|
-
describe InterfaceEndRecord do
|
11
|
-
it "should pack correctly" do
|
12
|
-
b = InterfaceEndRecord.new
|
13
|
-
b.to_biff.unpack('M*').should === ["\342\000\000\000"]
|
14
|
-
end
|
15
|
-
end
|
16
|
-
|
17
|
-
describe MMSRecord do
|
18
|
-
it "should pack correctly" do
|
19
|
-
b = MMSRecord.new
|
20
|
-
b.to_biff.unpack('M*').should === ["\301\000\002\000\000\000"]
|
21
|
-
end
|
22
|
-
end
|
23
|
-
|
24
|
-
describe WriteAccessRecord do
|
25
|
-
it "should pack correctly" do
|
26
|
-
b = WriteAccessRecord.new("Ana")
|
27
|
-
b.to_biff.unpack('M*').should === ["\\\000p\000Ana" + " " * 109]
|
28
|
-
end
|
29
|
-
end
|
30
|
-
|
31
|
-
describe DSFRecord do
|
32
|
-
it "should pack correctly" do
|
33
|
-
b = DSFRecord.new
|
34
|
-
b.to_biff.unpack('M*').should === ["a\001\002\000\000\000"]
|
35
|
-
end
|
36
|
-
end
|
37
|
-
|
38
|
-
describe TabIDRecord do
|
39
|
-
it "should pack correctly" do
|
40
|
-
b = TabIDRecord.new(2)
|
41
|
-
b.record_data.should === "\001\000\002\000"
|
42
|
-
b.to_biff.unpack('A*').should === ["=\001\004\000\001\000\002"]
|
43
|
-
end
|
44
|
-
end
|
45
|
-
|
46
|
-
describe FnGroupCountRecord do
|
47
|
-
it "should pack correctly" do
|
48
|
-
b = FnGroupCountRecord.new
|
49
|
-
b.record_data.should === "\016\000"
|
50
|
-
b.to_biff.unpack('A*').should === ["\234\000\002\000\016"]
|
51
|
-
end
|
52
|
-
end
|
53
|
-
|
54
|
-
describe WindowProtectRecord do
|
55
|
-
it "should pack correctly" do
|
56
|
-
b = WindowProtectRecord.new(0)
|
57
|
-
b.record_data.should === "\000\000"
|
58
|
-
b.to_biff.unpack('A*').should === ["\031\000\002"]
|
59
|
-
end
|
60
|
-
end
|
61
|
-
|
62
|
-
describe ObjectProtectRecord do
|
63
|
-
it "should pack correctly" do
|
64
|
-
b = ObjectProtectRecord.new(0)
|
65
|
-
b.record_data.should === "\000\000"
|
66
|
-
b.to_biff.unpack('A*').should === ["c\000\002"]
|
67
|
-
end
|
68
|
-
end
|
69
|
-
|
70
|
-
describe ScenarioProtectRecord do
|
71
|
-
it "should pack correctly" do
|
72
|
-
b = ScenarioProtectRecord.new(0)
|
73
|
-
b.record_data.should === "\000\000"
|
74
|
-
b.to_biff.unpack('A*').should === ["\335\000\002"]
|
75
|
-
end
|
76
|
-
end
|
77
|
-
|
78
|
-
describe PasswordRecord do
|
79
|
-
before(:each) do
|
80
|
-
@b = PasswordRecord.new
|
81
|
-
end
|
82
|
-
it "should pack correctly with blank password" do
|
83
|
-
@b.password_hash("").should == 0
|
84
|
-
end
|
85
|
-
|
86
|
-
it "should pack correctly with a password of 123456" do
|
87
|
-
@b.password_hash("123456").should === 50975
|
88
|
-
end
|
89
|
-
|
90
|
-
it "should pack correctly with a password of abcdefghij" do
|
91
|
-
@b.password_hash("abcdefghij").should == 65265
|
92
|
-
end
|
93
|
-
|
94
|
-
it "should pack correctly with a password of ok" do
|
95
|
-
@b.password_hash("ok").should == 53051
|
96
|
-
end
|
97
|
-
end
|
98
|
-
|
99
|
-
describe Prot4RevRecord do
|
100
|
-
it "should pack correctly" do
|
101
|
-
b = Prot4RevRecord.new
|
102
|
-
b.record_data.should === "\000\000"
|
103
|
-
b.to_biff.unpack('A*').should === ["\257\001\002"]
|
104
|
-
end
|
105
|
-
end
|
106
|
-
|
107
|
-
describe Prot4RevPassRecord do
|
108
|
-
it "should pack correctly" do
|
109
|
-
b = Prot4RevPassRecord.new
|
110
|
-
b.record_data.should === "\000\000"
|
111
|
-
b.to_biff.unpack('A*').should === ["\274\001\002"]
|
112
|
-
end
|
113
|
-
end
|
114
|
-
|
115
|
-
describe BackupRecord do
|
116
|
-
it "should pack correctly" do
|
117
|
-
b = BackupRecord.new(0)
|
118
|
-
b.record_data.should === "\000\000"
|
119
|
-
b.to_biff.unpack('A*').should === ["@\000\002"]
|
120
|
-
end
|
121
|
-
end
|
122
|
-
|
123
|
-
describe HideObjRecord do
|
124
|
-
it "should pack correctly" do
|
125
|
-
b = HideObjRecord.new
|
126
|
-
b.record_data.should === "\000\000"
|
127
|
-
b.to_biff.unpack('A*').should === ["\215\000\002"]
|
128
|
-
end
|
129
|
-
end
|
130
|
-
|
131
|
-
describe RefreshAllRecord do
|
132
|
-
it "should pack correctly" do
|
133
|
-
b = RefreshAllRecord.new
|
134
|
-
b.record_data.should === "\000\000"
|
135
|
-
b.to_biff.unpack('A*').should === ["\267\001\002"]
|
136
|
-
end
|
137
|
-
end
|
138
|
-
|
139
|
-
describe BookBoolRecord do
|
140
|
-
it "should pack correctly" do
|
141
|
-
b = BookBoolRecord.new
|
142
|
-
b.record_data.should === "\000\000"
|
143
|
-
b.to_biff.unpack('A*').should === ["\332\000\002"]
|
144
|
-
end
|
145
|
-
end
|
146
|
-
|
147
|
-
describe CountryRecord do
|
148
|
-
it "should pack correctly" do
|
149
|
-
b = CountryRecord.new(1,1)
|
150
|
-
b.record_data.should === "\001\000\001\000"
|
151
|
-
b.to_biff.unpack('A*').should === ["\332\000\004\000\001\000\001"]
|
152
|
-
end
|
153
|
-
end
|
154
|
-
|
155
|
-
describe UseSelfsRecord do
|
156
|
-
it "should pack correctly" do
|
157
|
-
b = UseSelfsRecord.new
|
158
|
-
b.record_data.should === "\001\000"
|
159
|
-
b.to_biff.unpack('A*').should === ["`\001\002\000\001"]
|
160
|
-
end
|
161
|
-
end
|
162
|
-
|
163
|
-
describe EOFRecord do
|
164
|
-
it "should pack correctly" do
|
165
|
-
b = EOFRecord.new
|
166
|
-
b.record_data.should === ""
|
167
|
-
b.to_biff.unpack('A*').should === ["\n"]
|
168
|
-
end
|
169
|
-
end
|
170
|
-
|
171
|
-
describe DateModeRecord do
|
172
|
-
it "should pack correctly when passed true" do
|
173
|
-
b = DateModeRecord.new(true)
|
174
|
-
b.record_data.should === "\001\000"
|
175
|
-
b.to_biff.unpack('A*').should === ["\"\000\002\000\001"]
|
176
|
-
end
|
177
|
-
it "should pack correctly when passed false" do
|
178
|
-
b = DateModeRecord.new(false)
|
179
|
-
b.record_data.should === "\000\000"
|
180
|
-
b.to_biff.unpack('A*').should === ["\"\000\002"]
|
181
|
-
end
|
182
|
-
end
|
183
|
-
|
184
|
-
describe PrecisionRecord do
|
185
|
-
it "should pack correctly when passed true" do
|
186
|
-
b = PrecisionRecord.new(true)
|
187
|
-
b.record_data.should === "\001\000"
|
188
|
-
b.to_biff.unpack('A*').should === ["\016\000\002\000\001"]
|
189
|
-
end
|
190
|
-
it "should pack correctly when passed false" do
|
191
|
-
b = PrecisionRecord.new(false)
|
192
|
-
b.record_data.should === "\000\000"
|
193
|
-
b.to_biff.unpack('A*').should === ["\016\000\002"]
|
194
|
-
end
|
195
|
-
end
|
196
|
-
|
197
|
-
describe CodepageBiff8Record do
|
198
|
-
it "should pack correctly" do
|
199
|
-
b = CodepageBiff8Record.new
|
200
|
-
b.record_data.should === "\260\004"
|
201
|
-
b.to_biff.unpack('A*').should === ["B\000\002\000\260\004"]
|
202
|
-
end
|
203
|
-
end
|
204
|
-
|
205
|
-
describe Window1Record do
|
206
|
-
it "should pack correctly" do
|
207
|
-
b = Window1Record.new(1,1,1,1,1,1,1,1,1)
|
208
|
-
b.record_data.should === "\001\000\001\000\001\000\001\000\001\000\001\000\001\000\001\000\001\000"
|
209
|
-
b.to_biff.unpack('A*').should === ["=\000\022\000\001\000\001\000\001\000\001\000\001\000\001\000\001\000\001\000\001"]
|
210
|
-
end
|
211
|
-
end
|
212
|
-
|
213
|
-
describe FontRecord do
|
214
|
-
it "should pack correctly" do
|
215
|
-
|
216
|
-
b = FontRecord.new(200,0,32767,400,0,0,0,204,"Arial")
|
217
|
-
b.record_data.should === "\310\000\000\000\377\177\220\001\000\000\000\000\314\000\005\000Arial"
|
218
|
-
end
|
219
|
-
end
|
220
|
-
|
221
|
-
# describe XFRecord do
|
222
|
-
# it "should pack correctly" do
|
223
|
-
# b = XFRecord.new([1,1,Alignment.new,Borders.new,Pattern.new,Protection.new])
|
224
|
-
# puts binary_string_to_hex_array(b.record_data)
|
225
|
-
# b.record_data.should === "\001\000\001\000\001\000"
|
226
|
-
# b.to_biff.unpack('A*').should === ["\257\001\002"]
|
227
|
-
# end
|
228
|
-
# end
|
229
|
-
|
230
|
-
describe StyleRecord do
|
231
|
-
it "should pack correctly" do
|
232
|
-
b = StyleRecord.new
|
233
|
-
b.record_data.should === "\000\200\000\377"
|
234
|
-
b.to_biff.unpack('A*').should === ["\223\002\004\000\000\200\000\377"]
|
235
|
-
end
|
236
|
-
end
|
237
|
-
|
238
|
-
describe BoundSheetRecord do
|
239
|
-
it "should pack correctly" do
|
240
|
-
b = BoundSheetRecord.new(0, 0, "x")
|
241
|
-
b.record_data.should === "\000\000\000\000\000\000\001\000x"
|
242
|
-
b.to_biff.unpack('A*').should === ["\205\000\t\000\000\000\000\000\000\000\001\000x"]
|
243
|
-
end
|
244
|
-
end
|
245
|
-
|
246
|
-
# describe ExtSSTRecord do
|
247
|
-
# it "should pack correctly" do
|
248
|
-
# b = ExtSSTRecord.new(1,[1],1)
|
249
|
-
# b.record_data.should === "\000\000"
|
250
|
-
# b.to_biff.unpack('A*').should === ["\257\001\002"]
|
251
|
-
# end
|
252
|
-
# end
|
253
|
-
|
254
|
-
describe DimensionsRecord do
|
255
|
-
it "should pack correctly" do
|
256
|
-
b = DimensionsRecord.new(0,0,5,5)
|
257
|
-
b.record_data.should === "\000\000\000\000\001\000\000\000\005\000\006\000\000\000"
|
258
|
-
b.to_biff.unpack('A*').should === ["\000\002\016\000\000\000\000\000\001\000\000\000\005\000\006"]
|
259
|
-
end
|
260
|
-
end
|
261
|
-
|
262
|
-
# describe MergedCellsRecord do
|
263
|
-
# it "should pack correctly" do
|
264
|
-
# b = MergedCellsRecord.new([[1,1,2,2]])
|
265
|
-
# b.record_data.should === "\345\000\n\000\001\000\001\000\001\000\002\000\002\000"
|
266
|
-
# b.to_biff.unpack('A*').should === ["\345\000\n\000\001\000\001\000\001\000\002\000\002"]
|
267
|
-
# end
|
268
|
-
# end
|
data/spec/cell_spec.rb
DELETED
@@ -1,56 +0,0 @@
|
|
1
|
-
require File.dirname(__FILE__) + '/spec_helper'
|
2
|
-
|
3
|
-
describe NumberCell, "to_biff" do
|
4
|
-
before(:all) do
|
5
|
-
@w = Workbook.new
|
6
|
-
@s = @w.add_sheet('rk_tests')
|
7
|
-
end
|
8
|
-
|
9
|
-
it "should encode with rk_encode" do
|
10
|
-
TEST_VALUES.each_with_index do |x, i|
|
11
|
-
# Write original test values
|
12
|
-
@s.write(i, 0, x)
|
13
|
-
|
14
|
-
# Write test values divided by 100
|
15
|
-
@s.write(i, 3, x/100.00)
|
16
|
-
|
17
|
-
# Write negative of test values
|
18
|
-
@s.write(i, 6, x)
|
19
|
-
|
20
|
-
# Write negative test values divided by 100
|
21
|
-
@s.write(i, 9, -x/100.00)
|
22
|
-
end
|
23
|
-
end
|
24
|
-
|
25
|
-
after(:all) do
|
26
|
-
@w.save("spec/output/cells-rk.xls")
|
27
|
-
end
|
28
|
-
end
|
29
|
-
|
30
|
-
TEST_VALUES = [
|
31
|
-
130.63999999999999,
|
32
|
-
130.64,
|
33
|
-
-18.649999999999999,
|
34
|
-
-18.65,
|
35
|
-
137.19999999999999,
|
36
|
-
137.20,
|
37
|
-
-16.079999999999998,
|
38
|
-
-16.08,
|
39
|
-
0,
|
40
|
-
1,
|
41
|
-
2,
|
42
|
-
3,
|
43
|
-
0x1fffffff,
|
44
|
-
0x20000000,
|
45
|
-
0x20000001,
|
46
|
-
1000999999,
|
47
|
-
0x3fffffff,
|
48
|
-
0x40000000,
|
49
|
-
0x40000001,
|
50
|
-
0x7fffffff,
|
51
|
-
0x80000000,
|
52
|
-
0x80000001,
|
53
|
-
0xffffffff,
|
54
|
-
0x100000000,
|
55
|
-
0x100000001
|
56
|
-
]
|