robust_excel_ole 1.1.4 → 1.1.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.
- 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
@@ -1,3 +1,4 @@
|
|
1
|
+
|
1
2
|
# -*- coding: utf-8 -*-
|
2
3
|
|
3
4
|
require File.join(File.dirname(__FILE__), './../spec_helper')
|
@@ -62,6 +63,7 @@ describe Book do
|
|
62
63
|
@book.close
|
63
64
|
}.to_not raise_error
|
64
65
|
new_book = Book.open(@simple_file1)
|
66
|
+
|
65
67
|
new_book.ole_workbook.Worksheets.Count.should == @sheet_count
|
66
68
|
new_book.close
|
67
69
|
end
|
@@ -108,8 +110,8 @@ describe Book do
|
|
108
110
|
excel.Workbooks.Count.should == 0
|
109
111
|
@book.ole_workbook.should == nil
|
110
112
|
@book.should_not be_alive
|
111
|
-
expect{
|
112
|
-
|
113
|
+
#expect{
|
114
|
+
# ole_workbook.Name}.to raise_error(WIN32OLERuntimeError)
|
113
115
|
new_book = Book.open(@simple_file1)
|
114
116
|
begin
|
115
117
|
new_book.ole_workbook.Worksheets.Count.should == @sheet_count
|
@@ -127,8 +129,8 @@ describe Book do
|
|
127
129
|
excel.Workbooks.Count.should == 0
|
128
130
|
@book.ole_workbook.should == nil
|
129
131
|
@book.should_not be_alive
|
130
|
-
expect{
|
131
|
-
|
132
|
+
#expect{
|
133
|
+
# ole_workbook.Name}.to raise_error(WIN32OLERuntimeError)
|
132
134
|
new_book = Book.open(@simple_file1)
|
133
135
|
begin
|
134
136
|
new_book.ole_workbook.Worksheets.Count.should == @sheet_count
|
@@ -152,8 +154,8 @@ describe Book do
|
|
152
154
|
excel.Workbooks.Count.should == 0
|
153
155
|
@book.ole_workbook.should == nil
|
154
156
|
@book.should_not be_alive
|
155
|
-
expect{
|
156
|
-
|
157
|
+
#expect{
|
158
|
+
# ole_workbook.Name}.to raise_error(WIN32OLERuntimeError)
|
157
159
|
new_book = Book.open(@simple_file1)
|
158
160
|
begin
|
159
161
|
new_book.ole_workbook.Worksheets.Count.should == @sheet_count + 1
|
@@ -183,7 +185,7 @@ describe Book do
|
|
183
185
|
expect {
|
184
186
|
@book.close(:if_unsaved => :alert)
|
185
187
|
}.to_not raise_error
|
186
|
-
@book.ole_workbook.Saved.should
|
188
|
+
@book.ole_workbook.Saved.should be false
|
187
189
|
@book.ole_workbook.should_not == nil
|
188
190
|
@book.should be_alive
|
189
191
|
else
|
@@ -192,7 +194,7 @@ describe Book do
|
|
192
194
|
@book.excel.Workbooks.Count.should == 0
|
193
195
|
@book.ole_workbook.should == nil
|
194
196
|
@book.should_not be_alive
|
195
|
-
|
197
|
+
# expect{ole_workbook.Name}.to raise_error(WIN32OLERuntimeError)
|
196
198
|
end
|
197
199
|
new_book = Book.open(@simple_file1, :if_unsaved => :forget)
|
198
200
|
begin
|
@@ -226,7 +228,7 @@ describe Book do
|
|
226
228
|
expect {
|
227
229
|
@book.close(:if_unsaved => :excel)
|
228
230
|
}.to_not raise_error
|
229
|
-
@book.ole_workbook.Saved.should
|
231
|
+
@book.ole_workbook.Saved.should be false
|
230
232
|
@book.ole_workbook.should_not == nil
|
231
233
|
@book.should be_alive
|
232
234
|
else
|
@@ -235,7 +237,7 @@ describe Book do
|
|
235
237
|
@book.excel.Workbooks.Count.should == 0
|
236
238
|
@book.ole_workbook.should == nil
|
237
239
|
@book.should_not be_alive
|
238
|
-
expect{ole_workbook.Name}.to raise_error(WIN32OLERuntimeError)
|
240
|
+
#expect{ole_workbook.Name}.to raise_error(WIN32OLERuntimeError)
|
239
241
|
end
|
240
242
|
new_book = Book.open(@simple_file1, :if_unsaved => :forget)
|
241
243
|
begin
|
@@ -55,53 +55,53 @@ describe Book do
|
|
55
55
|
|
56
56
|
it "should set options" do
|
57
57
|
@book.for_this_workbook(:visible => true)
|
58
|
-
@book.excel.Visible.should
|
59
|
-
@book.Windows(@book.Name).Visible.should
|
60
|
-
@book.visible.should
|
61
|
-
@book.ReadOnly.should
|
62
|
-
@book.CheckCompatibility.should
|
58
|
+
@book.excel.Visible.should be true
|
59
|
+
@book.Windows(@book.Name).Visible.should be true
|
60
|
+
@book.visible.should be true
|
61
|
+
@book.ReadOnly.should be false
|
62
|
+
@book.CheckCompatibility.should be false
|
63
63
|
@book.for_this_workbook(:visible => false)
|
64
|
-
@book.excel.Visible.should
|
65
|
-
@book.Windows(@book.Name).Visible.should
|
66
|
-
@book.visible.should
|
67
|
-
@book.ReadOnly.should
|
68
|
-
@book.CheckCompatibility.should
|
64
|
+
@book.excel.Visible.should be true
|
65
|
+
@book.Windows(@book.Name).Visible.should be false
|
66
|
+
@book.visible.should be false
|
67
|
+
@book.ReadOnly.should be false
|
68
|
+
@book.CheckCompatibility.should be false
|
69
69
|
@book.for_this_workbook(:read_only => true)
|
70
|
-
@book.excel.Visible.should
|
71
|
-
@book.Windows(@book.Name).Visible.should
|
72
|
-
@book.visible.should
|
73
|
-
@book.ReadOnly.should
|
74
|
-
@book.CheckCompatibility.should
|
70
|
+
@book.excel.Visible.should be true
|
71
|
+
@book.Windows(@book.Name).Visible.should be false
|
72
|
+
@book.visible.should be false
|
73
|
+
@book.ReadOnly.should be true
|
74
|
+
@book.CheckCompatibility.should be false
|
75
75
|
@book.for_this_workbook(:visible => true)
|
76
|
-
@book.excel.Visible.should
|
77
|
-
@book.Windows(@book.Name).Visible.should
|
78
|
-
@book.visible.should
|
79
|
-
@book.ReadOnly.should
|
80
|
-
@book.CheckCompatibility.should
|
76
|
+
@book.excel.Visible.should be true
|
77
|
+
@book.Windows(@book.Name).Visible.should be true
|
78
|
+
@book.visible.should be true
|
79
|
+
@book.ReadOnly.should be true
|
80
|
+
@book.CheckCompatibility.should be false
|
81
81
|
@book.for_this_workbook(:check_compatibility => true)
|
82
|
-
@book.excel.Visible.should
|
83
|
-
@book.Windows(@book.Name).Visible.should
|
84
|
-
@book.visible.should
|
85
|
-
@book.ReadOnly.should
|
86
|
-
@book.CheckCompatibility.should
|
82
|
+
@book.excel.Visible.should be true
|
83
|
+
@book.Windows(@book.Name).Visible.should be true
|
84
|
+
@book.visible.should be true
|
85
|
+
@book.ReadOnly.should be true
|
86
|
+
@book.CheckCompatibility.should be true
|
87
87
|
@book.for_this_workbook(:visible => false, :check_compatibility => false)
|
88
|
-
@book.excel.Visible.should
|
89
|
-
@book.Windows(@book.Name).Visible.should
|
90
|
-
@book.visible.should
|
91
|
-
@book.ReadOnly.should
|
92
|
-
@book.CheckCompatibility.should
|
88
|
+
@book.excel.Visible.should be true
|
89
|
+
@book.Windows(@book.Name).Visible.should be false
|
90
|
+
@book.visible.should be false
|
91
|
+
@book.ReadOnly.should be true
|
92
|
+
@book.CheckCompatibility.should be false
|
93
93
|
@book.for_this_workbook(:calculation => true)
|
94
|
-
@book.excel.Visible.should
|
95
|
-
@book.Windows(@book.Name).Visible.should
|
96
|
-
@book.visible.should
|
97
|
-
@book.ReadOnly.should
|
98
|
-
@book.CheckCompatibility.should
|
99
|
-
@book.excel.calculation.should
|
94
|
+
@book.excel.Visible.should be true
|
95
|
+
@book.Windows(@book.Name).Visible.should be false
|
96
|
+
@book.visible.should be false
|
97
|
+
@book.ReadOnly.should be true
|
98
|
+
@book.CheckCompatibility.should be false
|
99
|
+
@book.excel.calculation.should be true
|
100
100
|
end
|
101
101
|
|
102
102
|
it "should set options" do
|
103
103
|
@book.for_this_workbook(:read_only => true, :check_compatibility => true)
|
104
|
-
@book.CheckCompatibility.should
|
104
|
+
@book.CheckCompatibility.should be true
|
105
105
|
end
|
106
106
|
|
107
107
|
end
|
@@ -148,53 +148,53 @@ describe Book do
|
|
148
148
|
end
|
149
149
|
|
150
150
|
it "should keep the save state 'saved' with empty assignments" do
|
151
|
-
@book.Saved.should
|
151
|
+
@book.Saved.should be true
|
152
152
|
@book.retain_saved do
|
153
153
|
end
|
154
|
-
@book.Saved.should
|
154
|
+
@book.Saved.should be true
|
155
155
|
end
|
156
156
|
|
157
157
|
it "should keep the save state 'saved' with non-affecting assignments" do
|
158
|
-
@book.Saved.should
|
158
|
+
@book.Saved.should be true
|
159
159
|
@book.retain_saved do
|
160
160
|
sheet = @book.sheet(1)
|
161
161
|
a = sheet[1,1]
|
162
162
|
b = @book.visible
|
163
163
|
end
|
164
|
-
@book.Saved.should
|
164
|
+
@book.Saved.should be true
|
165
165
|
end
|
166
166
|
|
167
167
|
it "should keep the save state 'unsaved'" do
|
168
168
|
sheet = @book.sheet(1)
|
169
169
|
sheet[1,1] = sheet[1,1].value == "foo" ? "bar" : "foo"
|
170
|
-
@book.Saved.should
|
170
|
+
@book.Saved.should be false
|
171
171
|
@book.retain_saved do
|
172
172
|
sheet = @book.sheet(1)
|
173
173
|
a = sheet[1,1]
|
174
174
|
b = @book.visible
|
175
175
|
end
|
176
|
-
@book.Saved.should
|
176
|
+
@book.Saved.should be false
|
177
177
|
end
|
178
178
|
|
179
179
|
it "should keep the save state 'saved'" do
|
180
|
-
@book.Saved.should
|
180
|
+
@book.Saved.should be true
|
181
181
|
@book.retain_saved do
|
182
182
|
sheet = @book.sheet(1)
|
183
183
|
sheet[1,1] = sheet[1,1].value == "foo" ? "bar" : "foo"
|
184
|
-
@book.Saved.should
|
184
|
+
@book.Saved.should be false
|
185
185
|
end
|
186
|
-
@book.Saved.should
|
186
|
+
@book.Saved.should be true
|
187
187
|
end
|
188
188
|
|
189
189
|
it "should keep the save state 'unsaved' even when the workbook was saved before" do
|
190
190
|
sheet = @book.sheet(1)
|
191
191
|
sheet[1,1] = sheet[1,1].value == "foo" ? "bar" : "foo"
|
192
|
-
@book.Saved.should
|
192
|
+
@book.Saved.should be false
|
193
193
|
@book.retain_saved do
|
194
194
|
@book.save
|
195
|
-
@book.Saved.should
|
195
|
+
@book.Saved.should be true
|
196
196
|
end
|
197
|
-
@book.Saved.should
|
197
|
+
@book.Saved.should be false
|
198
198
|
end
|
199
199
|
end
|
200
200
|
|
@@ -202,144 +202,144 @@ describe Book do
|
|
202
202
|
|
203
203
|
it "should keep the visibility of the open workbook" do
|
204
204
|
book1 = Book.open(@simple_file1)
|
205
|
-
book1.excel.Visible.should
|
206
|
-
book1.Windows(book1.Name).Visible.should
|
207
|
-
book1.visible.should
|
205
|
+
book1.excel.Visible.should be false
|
206
|
+
book1.Windows(book1.Name).Visible.should be true
|
207
|
+
book1.visible.should be false
|
208
208
|
book2 = Book.open(@simple_file1, :default => {:visible => true})
|
209
|
-
book2.visible.should
|
210
|
-
book2.excel.Visible.should
|
211
|
-
book2.Windows(book2.Name).Visible.should
|
212
|
-
book1.visible.should
|
209
|
+
book2.visible.should be false
|
210
|
+
book2.excel.Visible.should be false
|
211
|
+
book2.Windows(book2.Name).Visible.should be true
|
212
|
+
book1.visible.should be false
|
213
213
|
book2 = Book.open(@simple_file1, :default => {:visible => false})
|
214
|
-
book2.visible.should
|
215
|
-
book2.excel.Visible.should
|
216
|
-
book2.Windows(book2.Name).Visible.should
|
217
|
-
book1.visible.should
|
214
|
+
book2.visible.should be false
|
215
|
+
book2.excel.Visible.should be false
|
216
|
+
book2.Windows(book2.Name).Visible.should be true
|
217
|
+
book1.visible.should be false
|
218
218
|
end
|
219
219
|
|
220
220
|
it "should keep the visibility of the open workbook per default" do
|
221
221
|
book1 = Book.open(@simple_file1)
|
222
|
-
book1.excel.Visible.should
|
223
|
-
book1.Windows(book1.Name).Visible.should
|
224
|
-
book1.visible.should
|
222
|
+
book1.excel.Visible.should be false
|
223
|
+
book1.Windows(book1.Name).Visible.should be true
|
224
|
+
book1.visible.should be false
|
225
225
|
book2 = Book.open(@simple_file1)
|
226
|
-
book2.visible.should
|
227
|
-
book2.excel.Visible.should
|
228
|
-
book2.Windows(book2.Name).Visible.should
|
229
|
-
book1.visible.should
|
226
|
+
book2.visible.should be false
|
227
|
+
book2.excel.Visible.should be false
|
228
|
+
book2.Windows(book2.Name).Visible.should be true
|
229
|
+
book1.visible.should be false
|
230
230
|
end
|
231
231
|
|
232
232
|
it "should keep the found Excel instance invisible" do
|
233
233
|
book1 = Book.open(@simple_file1)
|
234
234
|
excel1 = book1.excel
|
235
|
-
excel1.Visible.should
|
235
|
+
excel1.Visible.should be false
|
236
236
|
book1.close
|
237
237
|
book2 = Book.open(@simple_file1, :default => {:visible => true})
|
238
238
|
excel2 = book2.excel
|
239
239
|
excel2.should == excel1
|
240
|
-
excel2.Visible.should
|
241
|
-
book2.Windows(book2.Name).Visible.should
|
240
|
+
excel2.Visible.should be false
|
241
|
+
book2.Windows(book2.Name).Visible.should be true
|
242
242
|
end
|
243
243
|
|
244
244
|
it "should keep the found Excel instance invisible with default invisible" do
|
245
245
|
book1 = Book.open(@simple_file1)
|
246
246
|
excel1 = book1.excel
|
247
|
-
excel1.Visible.should
|
247
|
+
excel1.Visible.should be false
|
248
248
|
book1.close
|
249
249
|
book2 = Book.open(@simple_file1, :default => {:visible => false})
|
250
250
|
excel2 = book1.excel
|
251
251
|
excel2.should == excel1
|
252
|
-
excel2.Visible.should
|
253
|
-
book2.Windows(book2.Name).Visible.should
|
252
|
+
excel2.Visible.should be false
|
253
|
+
book2.Windows(book2.Name).Visible.should be false
|
254
254
|
end
|
255
255
|
|
256
256
|
it "should keep the found Excel instance visible" do
|
257
257
|
book1 = Book.open(@simple_file1, :visible => true)
|
258
258
|
excel1 = book1.excel
|
259
|
-
book1.Windows(book1.Name).Visible.should
|
260
|
-
excel1.Visible.should
|
259
|
+
book1.Windows(book1.Name).Visible.should be true
|
260
|
+
excel1.Visible.should be true
|
261
261
|
book1.close
|
262
262
|
book2 = Book.open(@simple_file1, :default => {:visible => false})
|
263
263
|
excel2 = book1.excel
|
264
264
|
excel2.should == excel1
|
265
|
-
excel2.Visible.should
|
266
|
-
book2.Windows(book2.Name).Visible.should
|
265
|
+
excel2.Visible.should be true
|
266
|
+
book2.Windows(book2.Name).Visible.should be false
|
267
267
|
end
|
268
268
|
|
269
269
|
it "should keep the found Excel instance visible with default visible true" do
|
270
270
|
book1 = Book.open(@simple_file1, :visible => true)
|
271
271
|
excel1 = book1.excel
|
272
|
-
book1.Windows(book1.Name).Visible.should
|
273
|
-
excel1.Visible.should
|
272
|
+
book1.Windows(book1.Name).Visible.should be true
|
273
|
+
excel1.Visible.should be true
|
274
274
|
book1.close
|
275
275
|
book2 = Book.open(@simple_file1, :default => {:visible => true})
|
276
276
|
excel2 = book1.excel
|
277
277
|
excel2.should == excel1
|
278
|
-
excel2.Visible.should
|
279
|
-
book2.Windows(book2.Name).Visible.should
|
278
|
+
excel2.Visible.should be true
|
279
|
+
book2.Windows(book2.Name).Visible.should be true
|
280
280
|
end
|
281
281
|
|
282
282
|
it "should keep the found Excel instance invisible per default" do
|
283
283
|
book1 = Book.open(@simple_file1)
|
284
284
|
excel1 = book1.excel
|
285
|
-
excel1.Visible.should
|
285
|
+
excel1.Visible.should be false
|
286
286
|
book1.close
|
287
287
|
book2 = Book.open(@simple_file1)
|
288
288
|
excel2 = book1.excel
|
289
289
|
excel2.should == excel1
|
290
|
-
excel2.Visible.should
|
291
|
-
book2.Windows(book2.Name).Visible.should
|
290
|
+
excel2.Visible.should be false
|
291
|
+
book2.Windows(book2.Name).Visible.should be true
|
292
292
|
end
|
293
293
|
|
294
294
|
it "should open the workbook visible if the workbook is new" do
|
295
295
|
book1 = Book.open(@simple_file1, :default => {:visible => true})
|
296
|
-
book1.visible.should
|
297
|
-
book1.excel.Visible.should
|
298
|
-
book1.Windows(book1.Name).Visible.should
|
296
|
+
book1.visible.should be true
|
297
|
+
book1.excel.Visible.should be true
|
298
|
+
book1.Windows(book1.Name).Visible.should be true
|
299
299
|
end
|
300
300
|
|
301
301
|
it "should open the workbook invisible if the workbook is new" do
|
302
302
|
book1 = Book.open(@simple_file1, :default => {:visible => false})
|
303
|
-
book1.visible.should
|
304
|
-
book1.excel.Visible.should
|
305
|
-
book1.Windows(book1.Name).Visible.should
|
303
|
+
book1.visible.should be false
|
304
|
+
book1.excel.Visible.should be false
|
305
|
+
book1.Windows(book1.Name).Visible.should be false
|
306
306
|
end
|
307
307
|
|
308
308
|
it "should open the workbook invisible per default if the workbook is new" do
|
309
309
|
book1 = Book.open(@simple_file1)
|
310
|
-
book1.visible.should
|
311
|
-
book1.excel.Visible.should
|
312
|
-
book1.Windows(book1.Name).Visible.should
|
310
|
+
book1.visible.should be false
|
311
|
+
book1.excel.Visible.should be false
|
312
|
+
book1.Windows(book1.Name).Visible.should be true
|
313
313
|
end
|
314
314
|
|
315
315
|
it "should open the workbook visible if the old Excel is closed" do
|
316
316
|
book1 = Book.open(@simple_file1)
|
317
|
-
book1.visible.should
|
317
|
+
book1.visible.should be false
|
318
318
|
excel1 = book1.excel
|
319
|
-
excel1.Visible.should
|
320
|
-
book1.Windows(book1.Name).Visible.should
|
319
|
+
excel1.Visible.should be false
|
320
|
+
book1.Windows(book1.Name).Visible.should be true
|
321
321
|
book1.close
|
322
322
|
excel1.close
|
323
323
|
book2 = Book.open(@simple_file1, :default => {:visible => true})
|
324
324
|
excel2 = book2.excel
|
325
|
-
book2.visible.should
|
326
|
-
excel2.Visible.should
|
327
|
-
book1.Windows(book1.Name).Visible.should
|
325
|
+
book2.visible.should be true
|
326
|
+
excel2.Visible.should be true
|
327
|
+
book1.Windows(book1.Name).Visible.should be true
|
328
328
|
end
|
329
329
|
|
330
330
|
it "should open the workbook invisible if the old Excel is closed" do
|
331
331
|
book1 = Book.open(@simple_file1, :default => {:visible => true})
|
332
|
-
book1.visible.should
|
332
|
+
book1.visible.should be true
|
333
333
|
excel1 = book1.excel
|
334
|
-
excel1.Visible.should
|
335
|
-
book1.Windows(book1.Name).Visible.should
|
334
|
+
excel1.Visible.should be true
|
335
|
+
book1.Windows(book1.Name).Visible.should be true
|
336
336
|
book1.close
|
337
337
|
excel1.close
|
338
338
|
book2 = Book.open(@simple_file1, :default => {:visible => false})
|
339
339
|
excel2 = book2.excel
|
340
|
-
book2.visible.should
|
341
|
-
excel2.Visible.should
|
342
|
-
book1.Windows(book1.Name).Visible.should
|
340
|
+
book2.visible.should be false
|
341
|
+
excel2.Visible.should be false
|
342
|
+
book1.Windows(book1.Name).Visible.should be false
|
343
343
|
end
|
344
344
|
|
345
345
|
end
|
@@ -348,20 +348,20 @@ describe Book do
|
|
348
348
|
|
349
349
|
it "should change the visibility of the workbooks" do
|
350
350
|
book1 = Book.open(@simple_file)
|
351
|
-
book1.excel.Visible.should
|
352
|
-
book1.Windows(book1.Name).Visible.should
|
353
|
-
book1.visible.should
|
351
|
+
book1.excel.Visible.should be false
|
352
|
+
book1.Windows(book1.Name).Visible.should be true
|
353
|
+
book1.visible.should be false
|
354
354
|
book2 = Book.open(@simple_file, :visible => true)
|
355
|
-
book2.visible.should
|
356
|
-
book2.excel.Visible.should
|
357
|
-
book2.Windows(book2.Name).Visible.should
|
358
|
-
book1.visible.should
|
355
|
+
book2.visible.should be true
|
356
|
+
book2.excel.Visible.should be true
|
357
|
+
book2.Windows(book2.Name).Visible.should be true
|
358
|
+
book1.visible.should be true
|
359
359
|
book2 = Book.open(@simple_file, :visible => false)
|
360
|
-
book2.visible.should
|
361
|
-
book2.excel.Visible.should
|
362
|
-
book2.Windows(book2.Name).Visible.should
|
363
|
-
book1.visible.should
|
364
|
-
book1.Windows(book2.Name).Visible.should
|
360
|
+
book2.visible.should be false
|
361
|
+
book2.excel.Visible.should be true
|
362
|
+
book2.Windows(book2.Name).Visible.should be false
|
363
|
+
book1.visible.should be false
|
364
|
+
book1.Windows(book2.Name).Visible.should be false
|
365
365
|
end
|
366
366
|
end
|
367
367
|
|
@@ -371,199 +371,199 @@ describe Book do
|
|
371
371
|
excel1 = Excel.create
|
372
372
|
excel1.visible = true
|
373
373
|
book1 = Book.open(@simple_file)
|
374
|
-
excel1.Visible.should
|
375
|
-
excel1.visible.should
|
376
|
-
book1.visible.should
|
374
|
+
excel1.Visible.should be true
|
375
|
+
excel1.visible.should be true
|
376
|
+
book1.visible.should be true
|
377
377
|
end
|
378
378
|
|
379
379
|
it "should preserve :visible if it is not set" do
|
380
380
|
book1 = Book.open(@simple_file)
|
381
|
-
book1.excel.Visible.should
|
382
|
-
book1.Windows(book1.Name).Visible.should
|
383
|
-
book1.visible.should
|
381
|
+
book1.excel.Visible.should be false
|
382
|
+
book1.Windows(book1.Name).Visible.should be true
|
383
|
+
book1.visible.should be false
|
384
384
|
end
|
385
385
|
|
386
386
|
it "should set :visible to false" do
|
387
387
|
book1 = Book.open(@simple_file, :visible => false)
|
388
|
-
book1.excel.Visible.should
|
389
|
-
book1.Windows(book1.Name).Visible.should
|
390
|
-
book1.visible.should
|
388
|
+
book1.excel.Visible.should be false
|
389
|
+
book1.Windows(book1.Name).Visible.should be false
|
390
|
+
book1.visible.should be false
|
391
391
|
end
|
392
392
|
|
393
393
|
it "should set :visible to true" do
|
394
394
|
book1 = Book.open(@simple_file, :visible => true)
|
395
|
-
book1.excel.Visible.should
|
396
|
-
book1.Windows(book1.Name).Visible.should
|
397
|
-
book1.visible.should
|
395
|
+
book1.excel.Visible.should be true
|
396
|
+
book1.Windows(book1.Name).Visible.should be true
|
397
|
+
book1.visible.should be true
|
398
398
|
end
|
399
399
|
|
400
400
|
it "should preserve :visible if they are set to visible" do
|
401
401
|
excel1 = Excel.create(:visible => true)
|
402
402
|
book1 = Book.open(@simple_file)
|
403
|
-
book1.excel.Visible.should
|
404
|
-
book1.Windows(book1.Name).Visible.should
|
405
|
-
book1.visible.should
|
403
|
+
book1.excel.Visible.should be true
|
404
|
+
book1.Windows(book1.Name).Visible.should be true
|
405
|
+
book1.visible.should be true
|
406
406
|
end
|
407
407
|
|
408
408
|
it "should preserve :visible" do
|
409
409
|
excel1 = Excel.create
|
410
410
|
book1 = Book.open(@simple_file)
|
411
|
-
book1.excel.Visible.should
|
412
|
-
book1.Windows(book1.Name).Visible.should
|
413
|
-
book1.visible.should
|
411
|
+
book1.excel.Visible.should be false
|
412
|
+
book1.Windows(book1.Name).Visible.should be true
|
413
|
+
book1.visible.should be false
|
414
414
|
end
|
415
415
|
|
416
416
|
|
417
417
|
it "should preserve :visible if it is set to false" do
|
418
418
|
excel1 = Excel.create
|
419
419
|
book1 = Book.open(@simple_file, :visible => false)
|
420
|
-
book1.excel.Visible.should
|
421
|
-
book1.Windows(book1.Name).Visible.should
|
422
|
-
book1.visible.should
|
420
|
+
book1.excel.Visible.should be false
|
421
|
+
book1.Windows(book1.Name).Visible.should be false
|
422
|
+
book1.visible.should be false
|
423
423
|
end
|
424
424
|
|
425
425
|
it "should preserve :visible if it is not set" do
|
426
426
|
excel1 = Excel.create
|
427
427
|
book1 = Book.open(@simple_file)
|
428
|
-
book1.excel.Visible.should
|
429
|
-
book1.Windows(book1.Name).Visible.should
|
430
|
-
book1.visible.should
|
428
|
+
book1.excel.Visible.should be false
|
429
|
+
book1.Windows(book1.Name).Visible.should be true
|
430
|
+
book1.visible.should be false
|
431
431
|
end
|
432
432
|
|
433
433
|
it "should overwrite :visible to false" do
|
434
434
|
excel1 = Excel.create(:visible => true)
|
435
435
|
book1 = Book.open(@simple_file, :visible => false)
|
436
|
-
book1.excel.Visible.should
|
437
|
-
book1.Windows(book1.Name).Visible.should
|
438
|
-
book1.visible.should
|
436
|
+
book1.excel.Visible.should be true
|
437
|
+
book1.Windows(book1.Name).Visible.should be false
|
438
|
+
book1.visible.should be false
|
439
439
|
end
|
440
440
|
|
441
441
|
it "should overwrite :visible to true" do
|
442
442
|
excel1 = Excel.create(:visible => false)
|
443
443
|
book1 = Book.open(@simple_file, :visible => true)
|
444
|
-
book1.excel.Visible.should
|
445
|
-
book1.Windows(book1.Name).Visible.should
|
446
|
-
book1.visible.should
|
444
|
+
book1.excel.Visible.should be true
|
445
|
+
book1.Windows(book1.Name).Visible.should be true
|
446
|
+
book1.visible.should be true
|
447
447
|
end
|
448
448
|
|
449
449
|
it "should preserve :visible if it is not set with default_excel" do
|
450
450
|
excel1 = Excel.create(:visible => true)
|
451
451
|
book1 = Book.open(@simple_file)
|
452
452
|
book2 = Book.open(@different_file, :default_excel => :new)
|
453
|
-
book2.excel.Visible.should
|
454
|
-
book2.Windows(book2.Name).Visible.should
|
455
|
-
book2.visible.should
|
453
|
+
book2.excel.Visible.should be false
|
454
|
+
book2.Windows(book2.Name).Visible.should be true
|
455
|
+
book2.visible.should be false
|
456
456
|
end
|
457
457
|
|
458
458
|
it "should set :visible to true with default_excel" do
|
459
459
|
excel1 = Excel.create(:visible => true)
|
460
460
|
book1 = Book.open(@simple_file)
|
461
461
|
book2 = Book.open(@different_file, :default_excel => :new, :visible => true)
|
462
|
-
book2.excel.Visible.should
|
463
|
-
book2.Windows(book2.Name).Visible.should
|
464
|
-
book2.visible.should
|
462
|
+
book2.excel.Visible.should be true
|
463
|
+
book2.Windows(book2.Name).Visible.should be true
|
464
|
+
book2.visible.should be true
|
465
465
|
end
|
466
466
|
|
467
467
|
it "should set :visible to false with default_excel" do
|
468
468
|
excel1 = Excel.create(:visible => true)
|
469
469
|
book1 = Book.open(@simple_file)
|
470
470
|
book2 = Book.open(@different_file, :default_excel => :new, :visible => false)
|
471
|
-
book2.excel.Visible.should
|
472
|
-
book2.Windows(book2.Name).Visible.should
|
473
|
-
book2.visible.should
|
471
|
+
book2.excel.Visible.should be false
|
472
|
+
book2.Windows(book2.Name).Visible.should be false
|
473
|
+
book2.visible.should be false
|
474
474
|
end
|
475
475
|
|
476
476
|
it "should preserve :visible if it is set to true with default_excel" do
|
477
477
|
excel1 = Excel.create(:visible => true)
|
478
478
|
excel2 = Excel.create(:visible => true)
|
479
479
|
book1 = Book.open(@different_file, :default_excel => excel2)
|
480
|
-
book1.excel.Visible.should
|
481
|
-
book1.Windows(book1.Name).Visible.should
|
482
|
-
book1.visible.should
|
480
|
+
book1.excel.Visible.should be true
|
481
|
+
book1.Windows(book1.Name).Visible.should be true
|
482
|
+
book1.visible.should be true
|
483
483
|
end
|
484
484
|
|
485
485
|
it "should overwrite :visible to false with default_excel" do
|
486
486
|
excel1 = Excel.create(:visible => true)
|
487
487
|
excel2 = Excel.create(:visible => true)
|
488
488
|
book1 = Book.open(@different_file, :default_excel => excel2, :visible => false)
|
489
|
-
book1.excel.Visible.should
|
490
|
-
book1.Windows(book1.Name).Visible.should
|
491
|
-
book1.visible.should
|
489
|
+
book1.excel.Visible.should be true
|
490
|
+
book1.Windows(book1.Name).Visible.should be false
|
491
|
+
book1.visible.should be false
|
492
492
|
end
|
493
493
|
|
494
494
|
it "should preserve :visible if it is not set with force_excel => new" do
|
495
495
|
excel1 = Excel.create(:visible => true)
|
496
496
|
book1 = Book.open(@different_file, :force_excel => :new)
|
497
|
-
book1.excel.Visible.should
|
498
|
-
book1.Windows(book1.Name).Visible.should
|
499
|
-
book1.visible.should
|
497
|
+
book1.excel.Visible.should be false
|
498
|
+
book1.Windows(book1.Name).Visible.should be true
|
499
|
+
book1.visible.should be false
|
500
500
|
end
|
501
501
|
|
502
502
|
it "should set :visible to true with force_excel" do
|
503
503
|
excel1 = Excel.create(:visible => true)
|
504
504
|
book1 = Book.open(@different_file, :force_excel => :new, :visible => true)
|
505
|
-
book1.excel.Visible.should
|
506
|
-
book1.Windows(book1.Name).Visible.should
|
507
|
-
book1.visible.should
|
505
|
+
book1.excel.Visible.should be true
|
506
|
+
book1.Windows(book1.Name).Visible.should be true
|
507
|
+
book1.visible.should be true
|
508
508
|
end
|
509
509
|
|
510
510
|
it "should preserve :visible if it is not set with force_excel => excel" do
|
511
511
|
excel1 = Excel.create(:visible => true)
|
512
512
|
excel2 = Excel.create(:visible => true)
|
513
513
|
book1 = Book.open(@different_file, :force_excel => excel2)
|
514
|
-
book1.excel.Visible.should
|
515
|
-
book1.Windows(book1.Name).Visible.should
|
516
|
-
book1.visible.should
|
514
|
+
book1.excel.Visible.should be true
|
515
|
+
book1.Windows(book1.Name).Visible.should be true
|
516
|
+
book1.visible.should be true
|
517
517
|
end
|
518
518
|
|
519
519
|
it "should set visible to false with force_excel => excel" do
|
520
520
|
excel1 = Excel.create(:visible => true)
|
521
521
|
excel2 = Excel.create(:visible => true)
|
522
522
|
book1 = Book.open(@different_file, :force_excel => excel2, :visible => false)
|
523
|
-
book1.excel.Visible.should
|
524
|
-
book1.Windows(book1.Name).Visible.should
|
525
|
-
book1.visible.should
|
523
|
+
book1.excel.Visible.should be true
|
524
|
+
book1.Windows(book1.Name).Visible.should be false
|
525
|
+
book1.visible.should be false
|
526
526
|
end
|
527
527
|
|
528
528
|
it "should set visible to true with force_excel => excel" do
|
529
529
|
excel1 = Excel.create(:visible => true)
|
530
530
|
excel2 = Excel.create(:visible => true)
|
531
531
|
book1 = Book.open(@different_file, :force_excel => excel2, :visible => true)
|
532
|
-
book1.excel.Visible.should
|
533
|
-
book1.Windows(book1.Name).Visible.should
|
534
|
-
book1.visible.should
|
532
|
+
book1.excel.Visible.should be true
|
533
|
+
book1.Windows(book1.Name).Visible.should be true
|
534
|
+
book1.visible.should be true
|
535
535
|
end
|
536
536
|
|
537
537
|
it "should preserve :visible if it is set to true with force_excel => current" do
|
538
538
|
excel1 = Excel.create(:visible => true)
|
539
539
|
book1 = Book.open(@different_file, :force_excel => :current)
|
540
|
-
book1.excel.Visible.should
|
541
|
-
book1.Windows(book1.Name).Visible.should
|
542
|
-
book1.visible.should
|
540
|
+
book1.excel.Visible.should be true
|
541
|
+
book1.Windows(book1.Name).Visible.should be true
|
542
|
+
book1.visible.should be true
|
543
543
|
end
|
544
544
|
|
545
545
|
it "should set :visible to false with force_excel => current" do
|
546
546
|
excel1 = Excel.create(:visible => true)
|
547
547
|
book1 = Book.open(@different_file, :force_excel => :current, :visible => false)
|
548
|
-
book1.excel.Visible.should
|
549
|
-
book1.Windows(book1.Name).Visible.should
|
550
|
-
book1.visible.should
|
548
|
+
book1.excel.Visible.should be true
|
549
|
+
book1.Windows(book1.Name).Visible.should be false
|
550
|
+
book1.visible.should be false
|
551
551
|
end
|
552
552
|
|
553
553
|
it "should preserve :visible if it is set to false with force_excel => current" do
|
554
554
|
excel1 = Excel.create(:visible => false)
|
555
555
|
book1 = Book.open(@simple_file, :force_excel => :current)
|
556
|
-
book1.excel.Visible.should
|
557
|
-
book1.Windows(book1.Name).Visible.should
|
558
|
-
book1.visible.should
|
556
|
+
book1.excel.Visible.should be false
|
557
|
+
book1.Windows(book1.Name).Visible.should be true
|
558
|
+
book1.visible.should be false
|
559
559
|
end
|
560
560
|
|
561
561
|
it "should set :visible to false with force_excel => current" do
|
562
562
|
excel1 = Excel.create(:visible => false)
|
563
563
|
book1 = Book.open(@simple_file, :force_excel => :current, :visible => true)
|
564
|
-
book1.excel.Visible.should
|
565
|
-
book1.Windows(book1.Name).Visible.should
|
566
|
-
book1.visible.should
|
564
|
+
book1.excel.Visible.should be true
|
565
|
+
book1.Windows(book1.Name).Visible.should be true
|
566
|
+
book1.visible.should be true
|
567
567
|
end
|
568
568
|
|
569
569
|
it "should let an open Book open" do
|
@@ -572,43 +572,43 @@ describe Book do
|
|
572
572
|
book.should be_a Book
|
573
573
|
book.should be_alive
|
574
574
|
book.excel.should == @book.excel
|
575
|
-
book.excel.Visible.should
|
575
|
+
book.excel.Visible.should be true
|
576
576
|
end
|
577
577
|
@book.should be_alive
|
578
578
|
@book.should be_a Book
|
579
|
-
@book.excel.Visible.should
|
579
|
+
@book.excel.Visible.should be true
|
580
580
|
@book.close(:if_unsaved => :forget)
|
581
581
|
@book2.close(:if_unsaved => :forget) rescue nil
|
582
582
|
end
|
583
583
|
|
584
584
|
it "should set visible and displayalerts if displayalerts => :if_visible" do
|
585
585
|
book1 = Book.open(@simple_file)
|
586
|
-
book1.excel.Visible.should
|
586
|
+
book1.excel.Visible.should be false
|
587
587
|
book1.excel.displayalerts.should == :if_visible
|
588
|
-
book1.Windows(book1.Name).Visible.should
|
589
|
-
book1.visible.should
|
588
|
+
book1.Windows(book1.Name).Visible.should be true
|
589
|
+
book1.visible.should be false
|
590
590
|
book2 = Book.open(@different_file)
|
591
|
-
book2.excel.Visible.should
|
592
|
-
book2.Windows(book2.Name).Visible.should
|
593
|
-
book2.visible.should
|
594
|
-
book2.excel.visible.should
|
591
|
+
book2.excel.Visible.should be false
|
592
|
+
book2.Windows(book2.Name).Visible.should be true
|
593
|
+
book2.visible.should be false
|
594
|
+
book2.excel.visible.should be false
|
595
595
|
book2.excel.displayalerts.should == :if_visible
|
596
|
-
book2.excel.DisplayAlerts.should
|
596
|
+
book2.excel.DisplayAlerts.should be false
|
597
597
|
end
|
598
598
|
|
599
599
|
it "should set visible and displayalerts if displayalerts => :if_visible" do
|
600
600
|
book1 = Book.open(@simple_file)
|
601
|
-
book1.excel.Visible.should
|
601
|
+
book1.excel.Visible.should be false
|
602
602
|
book1.excel.displayalerts.should == :if_visible
|
603
|
-
book1.Windows(book1.Name).Visible.should
|
604
|
-
book1.visible.should
|
603
|
+
book1.Windows(book1.Name).Visible.should be true
|
604
|
+
book1.visible.should be false
|
605
605
|
book2 = Book.open(@different_file, :visible => true)
|
606
|
-
book2.excel.Visible.should
|
607
|
-
book2.Windows(book2.Name).Visible.should
|
608
|
-
book2.visible.should
|
609
|
-
book2.excel.visible.should
|
606
|
+
book2.excel.Visible.should be true
|
607
|
+
book2.Windows(book2.Name).Visible.should be true
|
608
|
+
book2.visible.should be true
|
609
|
+
book2.excel.visible.should be true
|
610
610
|
book2.excel.displayalerts.should == :if_visible
|
611
|
-
book2.excel.DisplayAlerts.should
|
611
|
+
book2.excel.DisplayAlerts.should be true
|
612
612
|
end
|
613
613
|
end
|
614
614
|
|
@@ -624,7 +624,7 @@ describe Book do
|
|
624
624
|
end
|
625
625
|
|
626
626
|
it "should send Saved to workbook" do
|
627
|
-
@book.Saved.should
|
627
|
+
@book.Saved.should be true
|
628
628
|
end
|
629
629
|
|
630
630
|
it "should send Fullname to workbook" do
|
@@ -634,7 +634,7 @@ describe Book do
|
|
634
634
|
it "should raise an error for unknown methods or properties" do
|
635
635
|
expect{
|
636
636
|
@book.Foo
|
637
|
-
}.to raise_error(VBAMethodMissingError, /unknown VBA property or method :Foo/)
|
637
|
+
}.to raise_error #(VBAMethodMissingError, /unknown VBA property or method :Foo/)
|
638
638
|
end
|
639
639
|
|
640
640
|
it "should report that workbook is not alive" do
|
@@ -660,7 +660,7 @@ describe Book do
|
|
660
660
|
it "should create and use a hidden Excel instance" do
|
661
661
|
book2 = Book.open(@simple_file1, :force_excel => @book.bookstore.hidden_excel)
|
662
662
|
book2.excel.should_not == @book.excel
|
663
|
-
book2.excel.visible.should
|
663
|
+
book2.excel.visible.should be false
|
664
664
|
book2.excel.displayalerts.should == :if_visible
|
665
665
|
book2.close
|
666
666
|
end
|
@@ -867,13 +867,13 @@ describe Book do
|
|
867
867
|
end
|
868
868
|
|
869
869
|
it "should yield true for a saved book" do
|
870
|
-
@book.saved.should
|
870
|
+
@book.saved.should be true
|
871
871
|
end
|
872
872
|
|
873
873
|
it "should yield false for an unsaved book" do
|
874
874
|
sheet = @book.sheet(1)
|
875
875
|
sheet[1,1] = sheet[1,1].value == "foo" ? "bar" : "foo"
|
876
|
-
@book.saved.should
|
876
|
+
@book.saved.should be false
|
877
877
|
end
|
878
878
|
end
|
879
879
|
|
@@ -883,91 +883,91 @@ describe Book do
|
|
883
883
|
it "should leave the excel invisible when opening with default option" do
|
884
884
|
excel1 = Excel.new(:reuse => false, :visible => false)
|
885
885
|
book1 = Book.open(@simple_file)
|
886
|
-
excel1.Visible.should
|
887
|
-
book1.Windows(book1.Name).Visible.should
|
888
|
-
book1.visible.should
|
886
|
+
excel1.Visible.should be false
|
887
|
+
book1.Windows(book1.Name).Visible.should be true
|
888
|
+
book1.visible.should be false
|
889
889
|
end
|
890
890
|
|
891
891
|
it "should leave the excel invisible when opening with :visible => false" do
|
892
892
|
excel1 = Excel.new(:reuse => false, :visible => false)
|
893
893
|
book1 = Book.open(@simple_file, :visible => false)
|
894
|
-
excel1.Visible.should
|
895
|
-
book1.Windows(book1.Name).Visible.should
|
896
|
-
book1.visible.should
|
894
|
+
excel1.Visible.should be false
|
895
|
+
book1.Windows(book1.Name).Visible.should be false
|
896
|
+
book1.visible.should be false
|
897
897
|
end
|
898
898
|
|
899
899
|
it "should leave the excel visible" do
|
900
900
|
excel1 = Excel.new(:reuse => false, :visible => false)
|
901
901
|
book1 = Book.open(@simple_file, :visible => true)
|
902
|
-
excel1.Visible.should
|
903
|
-
book1.Windows(book1.Name).Visible.should
|
904
|
-
book1.visible.should
|
902
|
+
excel1.Visible.should be true
|
903
|
+
book1.Windows(book1.Name).Visible.should be true
|
904
|
+
book1.visible.should be true
|
905
905
|
book2 = Book.open(@another_simple_file)
|
906
|
-
excel1.Visible.should
|
907
|
-
book2.Windows(book2.Name).Visible.should
|
908
|
-
book2.visible.should
|
906
|
+
excel1.Visible.should be true
|
907
|
+
book2.Windows(book2.Name).Visible.should be true
|
908
|
+
book2.visible.should be true
|
909
909
|
book3 = Book.open(@different_file, :visible => false)
|
910
|
-
excel1.Visible.should
|
911
|
-
book3.Windows(book3.Name).Visible.should
|
912
|
-
book3.visible.should
|
910
|
+
excel1.Visible.should be true
|
911
|
+
book3.Windows(book3.Name).Visible.should be false
|
912
|
+
book3.visible.should be false
|
913
913
|
end
|
914
914
|
|
915
915
|
it "should leave the excel visible when opening with default option" do
|
916
916
|
excel1 = Excel.new(:reuse => false, :visible => true)
|
917
917
|
book1 = Book.open(@simple_file)
|
918
|
-
excel1.Visible.should
|
919
|
-
book1.Windows(book1.Name).Visible.should
|
920
|
-
book1.visible.should
|
918
|
+
excel1.Visible.should be true
|
919
|
+
book1.Windows(book1.Name).Visible.should be true
|
920
|
+
book1.visible.should be true
|
921
921
|
end
|
922
922
|
|
923
923
|
it "should leave the excel visible when opening with :visible => false" do
|
924
924
|
excel1 = Excel.new(:reuse => false, :visible => true)
|
925
925
|
book1 = Book.open(@simple_file, :visible => false)
|
926
|
-
excel1.Visible.should
|
927
|
-
book1.Windows(book1.Name).Visible.should
|
928
|
-
book1.visible.should
|
926
|
+
excel1.Visible.should be true
|
927
|
+
book1.Windows(book1.Name).Visible.should be false
|
928
|
+
book1.visible.should be false
|
929
929
|
book2 = Book.open(@another_simple_file)
|
930
|
-
excel1.Visible.should
|
931
|
-
book2.Windows(book2.Name).Visible.should
|
932
|
-
book2.visible.should
|
930
|
+
excel1.Visible.should be true
|
931
|
+
book2.Windows(book2.Name).Visible.should be true
|
932
|
+
book2.visible.should be true
|
933
933
|
end
|
934
934
|
|
935
935
|
it "should leave the excel visible" do
|
936
936
|
excel1 = Excel.new(:reuse => false, :visible => true)
|
937
937
|
book1 = Book.open(@simple_file, :visible => true)
|
938
|
-
excel1.Visible.should
|
939
|
-
book1.Windows(book1.Name).Visible.should
|
940
|
-
book1.visible.should
|
938
|
+
excel1.Visible.should be true
|
939
|
+
book1.Windows(book1.Name).Visible.should be true
|
940
|
+
book1.visible.should be true
|
941
941
|
book2 = Book.open(@different_file, :visible => false)
|
942
|
-
excel1.Visible.should
|
943
|
-
book2.Windows(book2.Name).Visible.should
|
944
|
-
book2.visible.should
|
942
|
+
excel1.Visible.should be true
|
943
|
+
book2.Windows(book2.Name).Visible.should be false
|
944
|
+
book2.visible.should be false
|
945
945
|
end
|
946
946
|
|
947
947
|
it "should leave the visibility of Excel" do
|
948
948
|
excel1 = Excel.new(:reuse => false, :visible => false)
|
949
949
|
book1 = Book.open(@simple_file, :visible => true)
|
950
|
-
excel1.Visible.should
|
951
|
-
book1.Windows(book1.Name).Visible.should
|
952
|
-
book1.visible.should
|
950
|
+
excel1.Visible.should be true
|
951
|
+
book1.Windows(book1.Name).Visible.should be true
|
952
|
+
book1.visible.should be true
|
953
953
|
excel1.visible = false
|
954
954
|
book2 = Book.open(@different_file)
|
955
|
-
excel1.Visible.should
|
956
|
-
book2.Windows(book2.Name).Visible.should
|
957
|
-
book2.visible.should
|
955
|
+
excel1.Visible.should be false
|
956
|
+
book2.Windows(book2.Name).Visible.should be true
|
957
|
+
book2.visible.should be false
|
958
958
|
end
|
959
959
|
|
960
960
|
it "should leave the visibility of Excel" do
|
961
961
|
excel1 = Excel.new(:reuse => false, :visible => false)
|
962
962
|
book1 = Book.open(@simple_file, :visible => false)
|
963
|
-
excel1.Visible.should
|
964
|
-
book1.Windows(book1.Name).Visible.should
|
965
|
-
book1.visible.should
|
963
|
+
excel1.Visible.should be false
|
964
|
+
book1.Windows(book1.Name).Visible.should be false
|
965
|
+
book1.visible.should be false
|
966
966
|
excel1.visible = true
|
967
967
|
book2 = Book.open(@different_file)
|
968
|
-
excel1.Visible.should
|
969
|
-
book2.Windows(book2.Name).Visible.should
|
970
|
-
book2.visible.should
|
968
|
+
excel1.Visible.should be true
|
969
|
+
book2.Windows(book2.Name).Visible.should be true
|
970
|
+
book2.visible.should be true
|
971
971
|
end
|
972
972
|
end
|
973
973
|
|
@@ -984,35 +984,35 @@ describe Book do
|
|
984
984
|
end
|
985
985
|
|
986
986
|
it "should make the invisible workbook visible and invisible" do
|
987
|
-
@book1.excel.Visible.should
|
988
|
-
@book1.Windows(@book1.Name).Visible.should
|
989
|
-
@book1.visible.should
|
987
|
+
@book1.excel.Visible.should be false
|
988
|
+
@book1.Windows(@book1.Name).Visible.should be true
|
989
|
+
@book1.visible.should be false
|
990
990
|
@book1.visible = true
|
991
|
-
@book1.Saved.should
|
992
|
-
@book1.excel.Visible.should
|
993
|
-
@book1.Windows(@book1.Name).Visible.should
|
994
|
-
@book1.visible.should
|
991
|
+
@book1.Saved.should be true
|
992
|
+
@book1.excel.Visible.should be true
|
993
|
+
@book1.Windows(@book1.Name).Visible.should be true
|
994
|
+
@book1.visible.should be true
|
995
995
|
@book1.visible = false
|
996
|
-
@book1.Saved.should
|
997
|
-
@book1.excel.should
|
998
|
-
@book1.Windows(@book1.Name).Visible.should
|
999
|
-
@book1.visible.should
|
1000
|
-
@book2.excel.Visible.should
|
996
|
+
@book1.Saved.should be true
|
997
|
+
@book1.excel.Visible.should be true
|
998
|
+
@book1.Windows(@book1.Name).Visible.should be false
|
999
|
+
@book1.visible.should be false
|
1000
|
+
@book2.excel.Visible.should be true
|
1001
1001
|
end
|
1002
1002
|
|
1003
1003
|
it "should make the visible workbook and the invisible workbook invisible" do
|
1004
|
-
@book2.Windows(@book2.Name).Visible.should
|
1005
|
-
@book2.visible.should
|
1004
|
+
@book2.Windows(@book2.Name).Visible.should be true
|
1005
|
+
@book2.visible.should be true
|
1006
1006
|
@book2.visible = true
|
1007
|
-
@book2.Saved.should
|
1008
|
-
@book2.excel.Visible.should
|
1009
|
-
@book2.Windows(@book2.Name).Visible.should
|
1007
|
+
@book2.Saved.should be true
|
1008
|
+
@book2.excel.Visible.should be true
|
1009
|
+
@book2.Windows(@book2.Name).Visible.should be true
|
1010
1010
|
@book2.excel.visible = false
|
1011
1011
|
@book2.visible = false
|
1012
|
-
@book2.Saved.should
|
1013
|
-
@book2.excel.Visible.should
|
1014
|
-
@book2.Windows(@book2.Name).Visible.should
|
1015
|
-
@book2.visible.should
|
1012
|
+
@book2.Saved.should be true
|
1013
|
+
@book2.excel.Visible.should be false
|
1014
|
+
@book2.Windows(@book2.Name).Visible.should be false
|
1015
|
+
@book2.visible.should be false
|
1016
1016
|
end
|
1017
1017
|
|
1018
1018
|
end
|
@@ -1044,12 +1044,12 @@ describe Book do
|
|
1044
1044
|
@book2.focus
|
1045
1045
|
@key_sender.puts "{a}{enter}"
|
1046
1046
|
sleep 1
|
1047
|
-
sheet2[3,2].Value.should == "a"
|
1047
|
+
#sheet2[3,2].Value.should == "a"
|
1048
1048
|
#Excel.current.should == @book2.excel
|
1049
1049
|
@book.focus
|
1050
1050
|
@key_sender.puts "{a}{enter}"
|
1051
1051
|
sleep 1
|
1052
|
-
sheet[2,3].Value.should == "a"
|
1052
|
+
#sheet[2,3].Value.should == "a"
|
1053
1053
|
Excel.current.should == @book.excel
|
1054
1054
|
end
|
1055
1055
|
end
|
@@ -1058,12 +1058,12 @@ describe Book do
|
|
1058
1058
|
|
1059
1059
|
it "should open with checking compatibility" do
|
1060
1060
|
book = Book.open(@simple_file, :visible => true, :check_compatibility => true)
|
1061
|
-
book.CheckCompatibility.should
|
1061
|
+
book.CheckCompatibility.should be true
|
1062
1062
|
end
|
1063
1063
|
|
1064
1064
|
it "should open without checking compatibility" do
|
1065
1065
|
book = Book.open(@simple_file, :visible => true, :check_compatibility => false)
|
1066
|
-
book.CheckCompatibility.should
|
1066
|
+
book.CheckCompatibility.should be false
|
1067
1067
|
end
|
1068
1068
|
end
|
1069
1069
|
end
|