robust_excel_ole 1.1.4 → 1.1.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Changelog +13 -0
- data/README.rdoc +107 -73
- data/{README_excel.rdoc → docs/README_excel.rdoc} +2 -0
- data/{README_open.rdoc → docs/README_open.rdoc} +12 -16
- data/{README_ranges.rdoc → docs/README_ranges.rdoc} +1 -1
- data/{README_save_close.rdoc → docs/README_save_close.rdoc} +0 -0
- data/{README_sheet.rdoc → docs/README_sheet.rdoc} +0 -0
- data/examples/open_save_close/example_control_to_excel.rb +3 -3
- data/examples/open_save_close/example_default_excel.rb +2 -2
- data/examples/open_save_close/example_force_excel.rb +2 -2
- data/examples/open_save_close/example_if_obstructed_closeifsaved.rb +2 -2
- data/examples/open_save_close/example_if_obstructed_forget.rb +2 -2
- data/examples/open_save_close/example_if_obstructed_save.rb +2 -2
- data/examples/open_save_close/example_if_unsaved_accept.rb +3 -3
- data/examples/open_save_close/example_if_unsaved_forget.rb +7 -3
- data/examples/open_save_close/example_if_unsaved_forget_more.rb +1 -1
- data/examples/open_save_close/example_read_only.rb +2 -2
- data/examples/open_save_close/example_rename_cells.rb +2 -2
- data/examples/open_save_close/example_reuse.rb +2 -2
- data/examples/open_save_close/example_simple.rb +1 -1
- data/examples/open_save_close/example_unobtrusively.rb +2 -2
- data/lib/robust_excel_ole/book.rb +75 -76
- data/lib/robust_excel_ole/bookstore.rb +9 -9
- data/lib/robust_excel_ole/excel.rb +5 -5
- data/lib/robust_excel_ole/general.rb +11 -4
- data/lib/robust_excel_ole/reo_common.rb +3 -0
- data/lib/robust_excel_ole/version.rb +1 -1
- data/robust_excel_ole.gemspec +2 -2
- data/spec/book_spec.rb +67 -63
- data/spec/book_specs/book_close_spec.rb +12 -10
- data/spec/book_specs/book_misc_spec.rb +279 -279
- data/spec/book_specs/book_open_spec.rb +258 -105
- data/spec/book_specs/book_save_spec.rb +28 -28
- data/spec/book_specs/book_unobtr_spec.rb +862 -164
- data/spec/bookstore_spec.rb +22 -22
- data/spec/data/another_workbook.xls +0 -0
- data/spec/data/different_workbook.xls +0 -0
- data/spec/data/workbook.xls +0 -0
- data/spec/excel_spec.rb +256 -254
- data/spec/general_spec.rb +7 -7
- data/spec/ruby1.8.6_rspec2.14/book_spec.rb +1421 -0
- data/spec/ruby1.8.6_rspec2.14/book_specs/book_all_spec.rb +22 -0
- data/spec/ruby1.8.6_rspec2.14/book_specs/book_close_spec.rb +252 -0
- data/spec/ruby1.8.6_rspec2.14/book_specs/book_misc_spec.rb +1070 -0
- data/spec/ruby1.8.6_rspec2.14/book_specs/book_open_spec.rb +1855 -0
- data/spec/ruby1.8.6_rspec2.14/book_specs/book_save_spec.rb +514 -0
- data/spec/ruby1.8.6_rspec2.14/book_specs/book_sheet_spec.rb +395 -0
- data/spec/ruby1.8.6_rspec2.14/book_specs/book_subclass_spec.rb +51 -0
- data/spec/ruby1.8.6_rspec2.14/book_specs/book_unobtr_spec.rb +1737 -0
- data/spec/ruby1.8.6_rspec2.14/bookstore_spec.rb +495 -0
- data/spec/ruby1.8.6_rspec2.14/cell_spec.rb +76 -0
- data/spec/ruby1.8.6_rspec2.14/cygwin_spec.rb +42 -0
- data/spec/ruby1.8.6_rspec2.14/excel_spec.rb +1820 -0
- data/spec/ruby1.8.6_rspec2.14/general_spec.rb +212 -0
- data/spec/ruby1.8.6_rspec2.14/range_spec.rb +131 -0
- data/spec/ruby1.8.6_rspec2.14/reo_common_spec.rb +130 -0
- data/spec/ruby1.8.6_rspec2.14/sheet_spec.rb +663 -0
- data/spec/ruby1.8.6_rspec2.14/spec_helper.rb +35 -0
- data/spec/sheet_spec.rb +2 -2
- metadata +28 -12
- data/README_detail.rdoc +0 -852
- data/README_development.rdoc +0 -5
@@ -0,0 +1,495 @@
|
|
1
|
+
# -*- coding: utf-8 -*-
|
2
|
+
|
3
|
+
require File.join(File.dirname(__FILE__), './spec_helper')
|
4
|
+
|
5
|
+
=begin
|
6
|
+
RSpec.configure do |config|
|
7
|
+
|
8
|
+
config.mock_with :rspec do |mocks|
|
9
|
+
mocks.syntax = :should
|
10
|
+
end
|
11
|
+
end
|
12
|
+
=end
|
13
|
+
|
14
|
+
$VERBOSE = nil
|
15
|
+
|
16
|
+
include RobustExcelOle
|
17
|
+
|
18
|
+
module RobustExcelOle
|
19
|
+
class MockBookstore # :nodoc: #
|
20
|
+
def fetch(filename, options = { })
|
21
|
+
nil
|
22
|
+
end
|
23
|
+
def store(book)
|
24
|
+
end
|
25
|
+
def print
|
26
|
+
puts "MockBookstore is always empty"
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
$mock_bookstore = MockBookstore.new
|
32
|
+
|
33
|
+
class Book
|
34
|
+
@@bookstore = $mock_bookstore
|
35
|
+
end
|
36
|
+
|
37
|
+
|
38
|
+
describe Bookstore do
|
39
|
+
|
40
|
+
before(:all) do
|
41
|
+
excel = Excel.new(:reuse => true)
|
42
|
+
open_books = excel == nil ? 0 : excel.Workbooks.Count
|
43
|
+
puts "*** open books *** : #{open_books}" if open_books > 0
|
44
|
+
Excel.kill_all
|
45
|
+
end
|
46
|
+
|
47
|
+
before do
|
48
|
+
@bookstore = Bookstore.new
|
49
|
+
@dir = create_tmpdir
|
50
|
+
@simple_file = @dir + '/workbook.xls'
|
51
|
+
@simple_save_file = @dir + '/workbook_save.xls'
|
52
|
+
@different_file = @dir + '/different_workbook.xls'
|
53
|
+
@simple_file_other_path = @dir + '/more_data/workbook.xls'
|
54
|
+
@simple_file1 = @simple_file
|
55
|
+
@different_file1 = @different_file
|
56
|
+
end
|
57
|
+
|
58
|
+
after do
|
59
|
+
begin
|
60
|
+
Excel.kill_all
|
61
|
+
rescue WeakRef::RefError => msg
|
62
|
+
puts "#{msg.message}"
|
63
|
+
Excel.kill_all
|
64
|
+
end
|
65
|
+
begin
|
66
|
+
rm_tmp(@dir) rescue nil
|
67
|
+
end
|
68
|
+
end
|
69
|
+
|
70
|
+
describe "create bookstore" do
|
71
|
+
context "with standard" do
|
72
|
+
it "should create book store" do
|
73
|
+
expect {
|
74
|
+
@book_store = Bookstore.new
|
75
|
+
}.to_not raise_error
|
76
|
+
@book_store.should be_a Bookstore
|
77
|
+
end
|
78
|
+
end
|
79
|
+
end
|
80
|
+
|
81
|
+
describe "Mock-Test" do
|
82
|
+
it "should never store any book" do
|
83
|
+
b1 = Book.open(@simple_file1)
|
84
|
+
b2 = Book.open(@simple_file1)
|
85
|
+
b2.object_id.should_not == b1.object_id
|
86
|
+
end
|
87
|
+
end
|
88
|
+
|
89
|
+
|
90
|
+
describe "fetch" do
|
91
|
+
|
92
|
+
context "with one open book" do
|
93
|
+
|
94
|
+
before do
|
95
|
+
@book = Book.open(@simple_file)
|
96
|
+
end
|
97
|
+
|
98
|
+
after do
|
99
|
+
@book.close rescue nil
|
100
|
+
end
|
101
|
+
|
102
|
+
it "should do simple store and fetch" do
|
103
|
+
@bookstore.store(@book)
|
104
|
+
new_book = @bookstore.fetch(@simple_file)
|
105
|
+
new_book.should be_a Book
|
106
|
+
new_book.should be_alive
|
107
|
+
new_book.should == @book
|
108
|
+
new_book.close
|
109
|
+
end
|
110
|
+
|
111
|
+
it "should fetch one book several times" do
|
112
|
+
@bookstore.store(@book)
|
113
|
+
book1 = @bookstore.fetch(@simple_file1)
|
114
|
+
book2 = @bookstore.fetch(@simple_file1)
|
115
|
+
expect(book1).to be_a Book
|
116
|
+
book1.should be_alive
|
117
|
+
book1.should == @book
|
118
|
+
book2.should be_a Book
|
119
|
+
book2.should be_alive
|
120
|
+
book2.should == @book
|
121
|
+
book1.should == book2
|
122
|
+
book1.close
|
123
|
+
book2.close
|
124
|
+
end
|
125
|
+
|
126
|
+
it "should fetch nothing without stóring before" do
|
127
|
+
new_book = @bookstore.fetch(@simple_file)
|
128
|
+
new_book.should == nil
|
129
|
+
end
|
130
|
+
|
131
|
+
it "should fetch a closed book" do
|
132
|
+
@bookstore.store(@book)
|
133
|
+
@book.close
|
134
|
+
book1 = @bookstore.fetch(@simple_file)
|
135
|
+
book1.should be_a Book
|
136
|
+
book1.should_not be_alive
|
137
|
+
end
|
138
|
+
|
139
|
+
it "should fetch nothing when fetching a different book" do
|
140
|
+
@bookstore.store(@book)
|
141
|
+
new_book = @bookstore.fetch(@different_file)
|
142
|
+
new_book.should == nil
|
143
|
+
end
|
144
|
+
|
145
|
+
it "should fetch nothing when fetching a non-existing book" do
|
146
|
+
@bookstore.store(@book)
|
147
|
+
new_book = @bookstore.fetch("foo")
|
148
|
+
new_book.should == nil
|
149
|
+
end
|
150
|
+
|
151
|
+
end
|
152
|
+
|
153
|
+
context "with several books" do
|
154
|
+
|
155
|
+
before do
|
156
|
+
@book = Book.open(@simple_file)
|
157
|
+
@bookstore.store(@book)
|
158
|
+
end
|
159
|
+
|
160
|
+
after do
|
161
|
+
@book.close
|
162
|
+
@book2.close(:if_unsaved => :forget)
|
163
|
+
end
|
164
|
+
|
165
|
+
it "should store and open two different books" do
|
166
|
+
@book2 = Book.open(@different_file1)
|
167
|
+
@bookstore.store(@book2)
|
168
|
+
new_book = @bookstore.fetch(@simple_file)
|
169
|
+
new_book2 = @bookstore.fetch(@different_file1)
|
170
|
+
new_book.should be_a Book
|
171
|
+
new_book.should be_alive
|
172
|
+
new_book.should == @book
|
173
|
+
new_book2.should be_a Book
|
174
|
+
new_book2.should be_alive
|
175
|
+
new_book2.should == @book2
|
176
|
+
new_book.should_not == new_book2
|
177
|
+
new_book.close
|
178
|
+
new_book2.close
|
179
|
+
end
|
180
|
+
|
181
|
+
it "should fetch the first, writable book" do
|
182
|
+
@book2 = Book.open(@simple_file1, :force_excel => :new)
|
183
|
+
@bookstore.store(@book2)
|
184
|
+
@book.ReadOnly.should be_false
|
185
|
+
@book2.ReadOnly.should be_true
|
186
|
+
new_book = @bookstore.fetch(@simple_file1)
|
187
|
+
new_book.should == @book
|
188
|
+
new_book.should_not == @book2
|
189
|
+
new_book.close
|
190
|
+
end
|
191
|
+
|
192
|
+
it "should fetch the last book with :prefer_writeable => false" do
|
193
|
+
@book2 = Book.open(@simple_file1, :force_excel => :new)
|
194
|
+
@bookstore.store(@book2)
|
195
|
+
@book.ReadOnly.should be_false
|
196
|
+
@book2.ReadOnly.should be_true
|
197
|
+
new_book = @bookstore.fetch(@simple_file1, :prefer_writable => false)
|
198
|
+
new_book.should_not == @book
|
199
|
+
new_book.should == @book2
|
200
|
+
new_book.close
|
201
|
+
end
|
202
|
+
|
203
|
+
it "should fetch the second, open book, if the first book is closed" do
|
204
|
+
@book2 = Book.open(@simple_file1, :force_excel => :new)
|
205
|
+
@bookstore.store(@book2)
|
206
|
+
@book.ReadOnly.should be_false
|
207
|
+
@book2.ReadOnly.should be_true
|
208
|
+
@book.close
|
209
|
+
new_book = @bookstore.fetch(@simple_file1, :prefer_writable => false)
|
210
|
+
new_book2 = @bookstore.fetch(@simple_file1)
|
211
|
+
new_book.should_not == @book
|
212
|
+
new_book2.should_not == @book
|
213
|
+
new_book.should == @book2
|
214
|
+
new_book2.should == @book2
|
215
|
+
new_book.close
|
216
|
+
new_book2.close
|
217
|
+
end
|
218
|
+
|
219
|
+
it "should fetch the first, open book, if the second book is closed, even with :prefer_writeable => false" do
|
220
|
+
@book2 = Book.open(@simple_file1, :force_excel => :new)
|
221
|
+
@bookstore.store(@book2)
|
222
|
+
@book.ReadOnly.should be_false
|
223
|
+
@book2.ReadOnly.should be_true
|
224
|
+
@book2.close
|
225
|
+
new_book = @bookstore.fetch(@simple_file1, :prefer_writable => false)
|
226
|
+
new_book2 = @bookstore.fetch(@simple_file1)
|
227
|
+
new_book.should_not == @book2
|
228
|
+
new_book2.should_not == @book2
|
229
|
+
new_book.should == @book
|
230
|
+
new_book2.should == @book
|
231
|
+
new_book.close
|
232
|
+
new_book2.close
|
233
|
+
end
|
234
|
+
|
235
|
+
end
|
236
|
+
|
237
|
+
context "with readonly book" do
|
238
|
+
|
239
|
+
before do
|
240
|
+
@book = Book.open(@simple_file, :read_only => true)
|
241
|
+
@bookstore.store(@book)
|
242
|
+
end
|
243
|
+
|
244
|
+
after do
|
245
|
+
@book.close
|
246
|
+
@book2.close(:if_unsaved => :forget)
|
247
|
+
end
|
248
|
+
|
249
|
+
it "should fetch the second, writable book" do
|
250
|
+
@book2 = Book.open(@simple_file1, :force_excel => :new)
|
251
|
+
@bookstore.store(@book2)
|
252
|
+
@book.ReadOnly.should be_true
|
253
|
+
@book2.ReadOnly.should be_false
|
254
|
+
new_book = @bookstore.fetch(@simple_file1)
|
255
|
+
new_book2 = @bookstore.fetch(@simple_file1, :prefer_writable => true)
|
256
|
+
new_book3 = @bookstore.fetch(@simple_file1, :prefer_writable => false)
|
257
|
+
new_book.should == @book2
|
258
|
+
new_book2.should == @book2
|
259
|
+
new_book3.should == @book2
|
260
|
+
new_book.should_not == @book
|
261
|
+
new_book2.should_not == @book
|
262
|
+
new_book3.should_not == @book
|
263
|
+
new_book.close
|
264
|
+
new_book2.close
|
265
|
+
new_book3.close
|
266
|
+
end
|
267
|
+
|
268
|
+
it "should fetch the recent readonly book when there are only readonly books" do
|
269
|
+
@book2 = Book.open(@simple_file1, :force_excel => :new, :read_only => true)
|
270
|
+
@bookstore.store(@book2)
|
271
|
+
@book.ReadOnly.should be_true
|
272
|
+
@book2.ReadOnly.should be_true
|
273
|
+
new_book = @bookstore.fetch(@simple_file1)
|
274
|
+
new_book.should == @book2
|
275
|
+
new_book.should_not == @book
|
276
|
+
new_book.close
|
277
|
+
end
|
278
|
+
|
279
|
+
it "should fetch the second, writable book, if a writable, a readonly and an unsaved readonly book exist" do
|
280
|
+
@book2 = Book.open(@simple_file1, :force_excel => :new)
|
281
|
+
@book3 = Book.open(@simple_file1, :force_excel => :new)
|
282
|
+
@bookstore.store(@book2)
|
283
|
+
@bookstore.store(@book3)
|
284
|
+
sheet = @book3.sheet(1)
|
285
|
+
sheet[1,1] = sheet[1,1].Value == "foo" ? "bar" : "foo"
|
286
|
+
@book.ReadOnly.should be_true
|
287
|
+
@book2.ReadOnly.should be_false
|
288
|
+
@book3.ReadOnly.should be_true
|
289
|
+
@book3.Saved.should be_false
|
290
|
+
new_book = @bookstore.fetch(@simple_file1)
|
291
|
+
new_book2 = @bookstore.fetch(@simple_file1, :prefer_writable => false)
|
292
|
+
new_book.should == @book2
|
293
|
+
new_book2.should == @book3
|
294
|
+
new_book.should_not == @book
|
295
|
+
new_book.should_not == @book3
|
296
|
+
new_book2.should_not == @book
|
297
|
+
new_book2.should_not == @book2
|
298
|
+
new_book.close
|
299
|
+
new_book2.close
|
300
|
+
end
|
301
|
+
end
|
302
|
+
|
303
|
+
context "with several closed books" do
|
304
|
+
|
305
|
+
before do
|
306
|
+
@book = Book.open(@simple_file1)
|
307
|
+
@bookstore.store(@book)
|
308
|
+
@bookstore.store(@book)
|
309
|
+
@book2 = Book.open(@simple_file1, :force_excel => :new)
|
310
|
+
@bookstore.store(@book2)
|
311
|
+
@book.close
|
312
|
+
@book2.close
|
313
|
+
end
|
314
|
+
|
315
|
+
it "should fetch the recent closed book" do
|
316
|
+
new_book = @bookstore.fetch(@simple_file)
|
317
|
+
new_book.should == @book2
|
318
|
+
new_book.should_not == @book
|
319
|
+
end
|
320
|
+
|
321
|
+
end
|
322
|
+
|
323
|
+
context "with changing file name" do
|
324
|
+
|
325
|
+
before do
|
326
|
+
@book = Book.open(@simple_file)
|
327
|
+
@book.save_as(@simple_save_file, :if_exists => :overwrite)
|
328
|
+
@bookstore.store(@book)
|
329
|
+
#@bookstore = @book.book_store
|
330
|
+
end
|
331
|
+
|
332
|
+
after do
|
333
|
+
@book.close
|
334
|
+
end
|
335
|
+
|
336
|
+
it "should return only book with correct file name" do
|
337
|
+
book1 = @bookstore.fetch(@simple_save_file)
|
338
|
+
book1.should == @book
|
339
|
+
end
|
340
|
+
|
341
|
+
it "should return only book with correct file name" do
|
342
|
+
book1 = @bookstore.fetch(@simple_file)
|
343
|
+
book1.should == nil
|
344
|
+
end
|
345
|
+
end
|
346
|
+
|
347
|
+
context "with given excel instance and fetching readonly" do
|
348
|
+
|
349
|
+
before do
|
350
|
+
@book = Book.open(@simple_file1)
|
351
|
+
@bookstore.store(@book)
|
352
|
+
@book2 = Book.open(@simple_file1, :force_excel => :new)
|
353
|
+
@bookstore.store(@book2)
|
354
|
+
end
|
355
|
+
|
356
|
+
after do
|
357
|
+
@book.close
|
358
|
+
end
|
359
|
+
|
360
|
+
it "should fetch the book in the given excel instance" do
|
361
|
+
@book.ReadOnly.should be_false
|
362
|
+
@book2.ReadOnly.should be_true
|
363
|
+
book_new = @bookstore.fetch(@simple_file, :prefer_excel => @book2.excel)
|
364
|
+
book_new.should be_a Book
|
365
|
+
book_new.should be_alive
|
366
|
+
book_new.should == @book2
|
367
|
+
end
|
368
|
+
end
|
369
|
+
end
|
370
|
+
|
371
|
+
describe "book life cycle" do
|
372
|
+
|
373
|
+
context "with an open book" do
|
374
|
+
|
375
|
+
before do
|
376
|
+
@book = Book.open(@simple_file)
|
377
|
+
@bookstore.store(@book)
|
378
|
+
end
|
379
|
+
|
380
|
+
after do
|
381
|
+
@book.close rescue nil
|
382
|
+
end
|
383
|
+
|
384
|
+
it "should find the book if the book has astill got a reference" do
|
385
|
+
GC.start
|
386
|
+
@bookstore.fetch(@simple_file).should == @book
|
387
|
+
end
|
388
|
+
|
389
|
+
it "should have forgotten the book if there is no reference anymore" do
|
390
|
+
@book = nil
|
391
|
+
GC.start
|
392
|
+
@bookstore.fetch(@simple_file).should == nil
|
393
|
+
end
|
394
|
+
|
395
|
+
it "should have forgotten some books if they have no reference anymore" do
|
396
|
+
book_new = Book.open(@different_file1)
|
397
|
+
@bookstore.store(book_new)
|
398
|
+
@book = nil
|
399
|
+
@book = "Bla"
|
400
|
+
@book = Book.open(@simple_file1)
|
401
|
+
@bookstore.store(@book)
|
402
|
+
@book = nil
|
403
|
+
GC.start
|
404
|
+
sleep 1
|
405
|
+
#@bookstore.fetch(simple_file1).should == nil
|
406
|
+
@bookstore.fetch(@different_file1).should == book_new
|
407
|
+
end
|
408
|
+
end
|
409
|
+
end
|
410
|
+
|
411
|
+
describe "books" do
|
412
|
+
|
413
|
+
before do
|
414
|
+
@book = Book.open(@simple_file)
|
415
|
+
@bookstore.store(@book)
|
416
|
+
@book2 = Book.open(@different_file)
|
417
|
+
@bookstore.store(@book2)
|
418
|
+
end
|
419
|
+
|
420
|
+
after do
|
421
|
+
@book.close
|
422
|
+
@book2.close
|
423
|
+
end
|
424
|
+
|
425
|
+
it "should show books" do
|
426
|
+
expect{
|
427
|
+
@bookstore.books}.to_not raise_error
|
428
|
+
end
|
429
|
+
|
430
|
+
end
|
431
|
+
|
432
|
+
describe "print" do
|
433
|
+
|
434
|
+
before do
|
435
|
+
@book = Book.open(@simple_file)
|
436
|
+
@bookstore.store(@book)
|
437
|
+
@book2 = Book.open(@different_file)
|
438
|
+
@bookstore.store(@book2)
|
439
|
+
end
|
440
|
+
|
441
|
+
after do
|
442
|
+
@book.close
|
443
|
+
@book2.close
|
444
|
+
end
|
445
|
+
|
446
|
+
it "should print books" do
|
447
|
+
@bookstore.print
|
448
|
+
end
|
449
|
+
|
450
|
+
end
|
451
|
+
|
452
|
+
|
453
|
+
|
454
|
+
describe "hidden_excel" do
|
455
|
+
|
456
|
+
context "with some open book" do
|
457
|
+
|
458
|
+
before do
|
459
|
+
@book = Book.open(@simple_file)
|
460
|
+
end
|
461
|
+
|
462
|
+
after do
|
463
|
+
@book.close
|
464
|
+
end
|
465
|
+
|
466
|
+
it "should create and use a hidden Excel instance" do
|
467
|
+
h_excel1 = @bookstore.hidden_excel
|
468
|
+
h_excel1.should_not == @book.excel
|
469
|
+
h_excel1.Visible.should be_false
|
470
|
+
h_excel1.DisplayAlerts.should be_false
|
471
|
+
book1 = Book.open(@simple_file, :force_excel => @bookstore.hidden_excel)
|
472
|
+
book1.excel.should === h_excel1
|
473
|
+
book1.excel.should_not === @book.excel
|
474
|
+
Excel.close_all
|
475
|
+
h_excel2 = @bookstore.hidden_excel
|
476
|
+
h_excel2.should_not == @book.excel
|
477
|
+
h_excel2.should_not == book1.excel
|
478
|
+
h_excel2.Visible.should be_false
|
479
|
+
h_excel2.DisplayAlerts.should be_false
|
480
|
+
book2 = Book.open(@simple_file, :force_excel => @bookstore.hidden_excel)
|
481
|
+
book2.excel.should === h_excel2
|
482
|
+
book2.excel.should_not === @book.excel
|
483
|
+
book2.excel.should_not === book1.excel
|
484
|
+
end
|
485
|
+
|
486
|
+
it "should exclude hidden excel" do
|
487
|
+
book1 = Book.open(@simple_file, :force_excel => @bookstore.hidden_excel)
|
488
|
+
@bookstore.store(book1)
|
489
|
+
book1.close
|
490
|
+
book2 = @bookstore.fetch(@simple_file)
|
491
|
+
book2.should == nil
|
492
|
+
end
|
493
|
+
end
|
494
|
+
end
|
495
|
+
end
|