Class: ODDB::TestExporter

Inherits:
Test::Unit::TestCase
  • Object
show all
Includes:
FlexMock::TestCase
Defined in:
test/test_util/exporter.rb

Instance Method Summary (collapse)

Instance Method Details

- (Object) setup



27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# File 'test/test_util/exporter.rb', line 27

def setup
  @app = flexmock('app') 
  @exporter = ODDB::Exporter.new(@app)
  flexstub(@exporter).should_receive(:sleep).and_return('sleep')
  @log = flexmock('log') do |log|
    log.should_receive(:report)
    log.should_receive(:notify)
    log.should_receive(:report=)
    log.should_receive(:date_str=)
  end

  # plugins
  # @plugins will be modifed depending on a test-case in each test method
  @plugin = flexmock('plugin')
  flexstub(OdbaExporter::OddbDatExport).should_receive(:new).and_return(@plugin)
  flexstub(SwissmedicPlugin).should_receive(:new).and_return(@plugin)
  flexstub(XlsExportPlugin).should_receive(:new).and_return(@plugin)
  flexstub(CsvExportPlugin).should_receive(:new).and_return(@plugin)
  flexstub(FiPDFExporter).should_receive(:new).and_return(@plugin)
  flexstub(OuwerkerkPlugin).should_receive(:new).and_return(@plugin)
  flexstub(YamlExporter).should_receive(:new).and_return(@plugin)
  flexstub(DownloadInvoicer).should_receive(:new).and_return(@plugin)
  flexstub(FachinfoInvoicer).should_receive(:new).and_return(@plugin)
  flexstub(PatinfoInvoicer).should_receive(:new).and_return(@plugin)
end

- (Object) test_export_all_csv



153
154
155
156
157
158
159
160
161
162
# File 'test/test_util/exporter.rb', line 153

def test_export_all_csv
  # totally white box test
  flexstub(@exporter) do |exp|
    exp.should_receive(:export_csv).once.with_no_args
    exp.should_receive(:export_doc_csv).once.with_no_args
    exp.should_receive(:export_index_therapeuticus_csv).once.with_no_args
    exp.should_receive(:export_price_history_csv).once.with_no_args.and_return('export_price_history_csv')
  end
  assert_equal('export_price_history_csv', @exporter.export_all_csv)
end

- (Object) test_export_analysis_csv



198
199
200
201
202
203
# File 'test/test_util/exporter.rb', line 198

def test_export_analysis_csv
  flexstub(@plugin) do |plug|
    plug.should_receive(:export_analysis)
  end
  assert_equal('sleep', @exporter.export_analysis_csv)
end

- (Object) test_export_competition_xls



163
164
165
166
167
168
# File 'test/test_util/exporter.rb', line 163

def test_export_competition_xls
  flexstub(@plugin) do |plug|
    plug.should_receive(:export_competition)
  end
  assert_equal(@plugin, @exporter.export_competition_xls('company'))
end

- (Object) test_export_csv



169
170
171
172
173
174
175
# File 'test/test_util/exporter.rb', line 169

def test_export_csv
  flexstub(@plugin) do |plug|
    plug.should_receive(:export_drugs)
    plug.should_receive(:export_drugs_extended)
  end
  assert_equal('sleep', @exporter.export_csv)
end

- (Object) test_export_csv__errorcase1



176
177
178
179
180
181
182
183
184
185
186
# File 'test/test_util/exporter.rb', line 176

def test_export_csv__errorcase1
  flexstub(@plugin) do |plug|
    plug.should_receive(:export_drugs).and_raise(StandardError)
    plug.should_receive(:export_drugs_extended)
  end
  flexstub(Log) do |logclass|
    # white box test: Log.new is once called because of error
    logclass.should_receive(:new).times(1).and_return(@log)
  end
  assert_equal('sleep', @exporter.export_csv)
end

- (Object) test_export_csv__errorcase2



187
188
189
190
191
192
193
194
195
196
197
# File 'test/test_util/exporter.rb', line 187

def test_export_csv__errorcase2
  flexstub(@plugin) do |plug|
    plug.should_receive(:export_drugs)
    plug.should_receive(:export_drugs_extended).and_raise(StandardError)
  end
  flexstub(Log) do |logclass|
    # white box test: Log.new is once called because of error
    logclass.should_receive(:new).times(1).and_return(@log)
  end
  assert_equal('sleep', @exporter.export_csv)
end

- (Object) test_export_doc_csv



204
205
206
207
208
209
# File 'test/test_util/exporter.rb', line 204

def test_export_doc_csv
  flexstub(@plugin) do |plug|
    plug.should_receive(:export_doctors)
  end
  assert_equal('sleep', @exporter.export_doc_csv)
end

- (Object) test_export_doc_csv__error



210
211
212
213
214
215
216
217
218
219
# File 'test/test_util/exporter.rb', line 210

def test_export_doc_csv__error
  flexstub(@plugin) do |plug|
    plug.should_receive(:export_doctors).and_raise(StandardError)
  end
  flexstub(Log) do |logclass|
    # white box test: Log.new is once called because of error
    logclass.should_receive(:new).times(1).and_return(@log)
  end
  assert_equal('sleep', @exporter.export_doc_csv)
end

- (Object) test_export_fachinfo_pdf



220
221
222
# File 'test/test_util/exporter.rb', line 220

def test_export_fachinfo_pdf
  # this method will be removed
end

- (Object) test_export_generics_xls



223
224
225
226
227
228
# File 'test/test_util/exporter.rb', line 223

def test_export_generics_xls
  flexstub(@plugin) do |plug|
    plug.should_receive(:export_generics)
  end
  assert_equal(@plugin, @exporter.export_generics_xls)
end

- (Object) test_export_helper



145
146
147
148
149
150
151
152
# File 'test/test_util/exporter.rb', line 145

def test_export_helper
  flexstub(Exporter::EXPORT_SERVER) do |exp|
    exp.should_receive(:remote_safe_export).and_yield('path')
  end
  @exporter.export_helper('name') do |path|
    assert_equal('path', path)
  end
end

- (Object) test_export_index_therapeuticus_csv



238
239
240
241
242
243
# File 'test/test_util/exporter.rb', line 238

def test_export_index_therapeuticus_csv
  flexstub(@plugin) do |plug|
    plug.should_receive(:export_index_therapeuticus)
  end
  assert_equal('sleep', @exporter.export_index_therapeuticus_csv)
end

- (Object) test_export_index_therapeuticus_csv__error



244
245
246
247
248
249
250
251
252
253
# File 'test/test_util/exporter.rb', line 244

def test_export_index_therapeuticus_csv__error
  flexstub(@plugin) do |plug|
    plug.should_receive(:export_index_therapeuticus).and_raise(StandardError)
  end
  flexstub(Log) do |logclass|
    # white box test: Log.new is once called because of error
    logclass.should_receive(:new).times(1).and_return(@log)
  end
  assert_equal('sleep', @exporter.export_index_therapeuticus_csv) 
end

- (Object) test_export_migel_csv



254
255
256
257
258
259
# File 'test/test_util/exporter.rb', line 254

def test_export_migel_csv
  flexstub(@plugin) do |plug|
    plug.should_receive(:export_migel)
  end
  assert_equal('sleep', @exporter.export_migel_csv)
end

- (Object) test_export_narcotics_csv



260
261
262
263
264
265
# File 'test/test_util/exporter.rb', line 260

def test_export_narcotics_csv
  flexstub(@plugin) do |plug|
    plug.should_receive(:export_narcotics)
  end
  assert_equal('sleep', @exporter.export_narcotics_csv)
end

- (Object) test_export_oddbdat__dose_missing



79
80
81
82
83
84
85
86
87
88
89
# File 'test/test_util/exporter.rb', line 79

def test_export_oddbdat__dose_missing
  flexstub(Log) do |logclass|
    # white box test: Log.new is once called because of dose data missing
    logclass.should_receive(:new).times(1).and_return(@log)
  end
  flexstub(@plugin) do |exporter|
      exporter.should_receive(:export).and_return(['dose_missing']) # this is the key point
  end

  assert_equal(nil, @exporter.export_oddbdat)
end

- (Object) test_export_oddbdat__on_monday



67
68
69
70
71
72
73
74
75
76
77
78
# File 'test/test_util/exporter.rb', line 67

def test_export_oddbdat__on_monday
  flexstub(@exporter, :today => Date.new(2011,1,3)) # Monday
  flexstub(Log) do |logclass|
    logclass.should_receive(:new).times(0).and_return(@log)
  end
  flexstub(@plugin) do |exporter|
      exporter.should_receive(:export).and_return([]) # this is the key point
      exporter.should_receive(:export_fachinfos).once.with_no_args
  end

  assert_equal(nil, @exporter.export_oddbdat)
end

- (Object) test_export_oddbdat__on_sunday



52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# File 'test/test_util/exporter.rb', line 52

def test_export_oddbdat__on_sunday
  flexstub(@exporter, :today => Date.new(2011,1,2))
  flexstub(Log) do |logclass|
    # white box test: Log.new is never called
    # if dose_missing_list is not empty or an error raises,
    # Log.new will be called
    logclass.should_receive(:new).times(0).and_return(@log)
  end
  flexstub(@plugin) do |exporter|
      exporter.should_receive(:export).and_return([]) # this is the key point
  end

  # the 'nil' means 'if' condition runs, otherwise it may indicate an error
  assert_equal(nil, @exporter.export_oddbdat)
end

- (Object) test_export_patents_xls



300
301
302
303
304
305
# File 'test/test_util/exporter.rb', line 300

def test_export_patents_xls
  flexstub(@plugin) do |plug|
    plug.should_receive(:export_patents)
  end
  assert_equal(@plugin, @exporter.export_patents_xls)
end

- (Object) test_export_pdf



266
267
268
269
270
271
# File 'test/test_util/exporter.rb', line 266

def test_export_pdf
  flexstub(@plugin) do |plug|
    plug.should_receive(:run).and_return('run')
  end
  assert_equal('run', @exporter.export_pdf)
end

- (Object) test_export_price_history_csv



428
429
430
431
432
433
434
435
436
437
# File 'test/test_util/exporter.rb', line 428

def test_export_price_history_csv
  flexstub(@plugin) do |plug|
    plug.should_receive(:export_price_history).and_raise(StandardError)
  end
  flexstub(Log) do |logclass|
    # white box test: Log.new is once called if there is an error
    logclass.should_receive(:new).times(1).and_return(@log)
  end
  assert_equal('sleep', @exporter.export_price_history_csv) 
end

- (Object) test_export_sl_pcodes



272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
# File 'test/test_util/exporter.rb', line 272

def test_export_sl_pcodes
  flexstub(@app) do |app|
    app.should_receive(:each_package).and_yield(flexmock('pac') do |pac|
      pac.should_receive(:sl_entry).and_return(true)
      pac.should_receive(:pharmacode).and_return('pharmacode')
    end)
  end
 
  # test
  expected = 'pharmacode'
  fh = flexmock('file_pointer') do |file_pointer|
    file_pointer.should_receive(:puts).with(expected)
  end
  flexstub(File) do |file|
    file.should_receive(:open).and_yield(fh)
  end
  assert_equal(nil, @exporter.export_sl_pcodes)
end

- (Object) test_export_sl_pcodes__error



290
291
292
293
294
295
296
297
298
299
# File 'test/test_util/exporter.rb', line 290

def test_export_sl_pcodes__error
  flexstub(File) do |file|
    file.should_receive(:open).and_raise(StandardError)
  end
  flexstub(Log) do |logclass|
    # white box test: Log.new is once called because of error
    logclass.should_receive(:new).times(1).and_return(@log)
  end
  assert_equal('sleep', @exporter.export_sl_pcodes)
end

- (Object) test_export_swissdrug_xls



229
230
231
232
233
234
235
236
237
# File 'test/test_util/exporter.rb', line 229

def test_export_swissdrug_xls
  flexstub(@plugin) do |plug|
    plug.should_receive(:export_xls)
    plug.should_receive(:file_path)
  end
  flexstub(FileUtils).should_receive(:cp)
  flexstub(Exporter::EXPORT_SERVER).should_receive(:compress)
  assert_equal(@plugin, @exporter.export_swissdrug_xls)
end

- (Object) test_export_yaml__on_monday



306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
# File 'test/test_util/exporter.rb', line 306

def test_export_yaml__on_monday
  flexstub(@exporter, :today => Date.new(2011,1,3)) # Monday
  # totally white box test
  flexstub(@plugin) do |plug|
    plug.should_receive(:export).once.with_no_args
    plug.should_receive(:export_atc_classes).once.with_no_args
    plug.should_receive(:export_interactions).once.with_no_args
    plug.should_receive(:export_narcotics).once.with_no_args
    plug.should_receive(:export_prices).once.with_no_args
    plug.should_receive(:export_fachinfos).times(0).with_no_args
    plug.should_receive(:export_patinfos).times(0).with_no_args
    plug.should_receive(:export_doctors).times(0).with_no_args
  end
  assert_equal('sleep', @exporter.export_yaml)
end

- (Object) test_export_yaml__on_thursday



351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
# File 'test/test_util/exporter.rb', line 351

def test_export_yaml__on_thursday
  flexstub(@exporter, :today => Date.new(2011,1,6)) # Tursday
  # totally white box test
  flexstub(@plugin) do |plug|
    plug.should_receive(:export).once.with_no_args
    plug.should_receive(:export_atc_classes).once.with_no_args
    plug.should_receive(:export_interactions).once.with_no_args
    plug.should_receive(:export_narcotics).once.with_no_args
    plug.should_receive(:export_prices).once.with_no_args
    plug.should_receive(:export_fachinfos).times(0).with_no_args
    plug.should_receive(:export_patinfos).times(0).with_no_args
    plug.should_receive(:export_doctors).once.with_no_args
  end
  assert_equal('sleep', @exporter.export_yaml)
end

- (Object) test_export_yaml__on_tuesday



321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
# File 'test/test_util/exporter.rb', line 321

def test_export_yaml__on_tuesday
  flexstub(@exporter, :today => Date.new(2011,1,4)) # Tuesday
  # totally white box test
  flexstub(@plugin) do |plug|
    plug.should_receive(:export).once.with_no_args
    plug.should_receive(:export_atc_classes).once.with_no_args
    plug.should_receive(:export_interactions).once.with_no_args
    plug.should_receive(:export_narcotics).once.with_no_args
    plug.should_receive(:export_prices).once.with_no_args
    plug.should_receive(:export_fachinfos).once.with_no_args
    plug.should_receive(:export_patinfos).times(0).with_no_args
    plug.should_receive(:export_doctors).times(0).with_no_args
  end
  assert_equal('sleep', @exporter.export_yaml)
end

- (Object) test_export_yaml__on_wednesday



336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
# File 'test/test_util/exporter.rb', line 336

def test_export_yaml__on_wednesday
  flexstub(@exporter, :today => Date.new(2011,1,5)) # Wednesday
  # totally white box test
  flexstub(@plugin) do |plug|
    plug.should_receive(:export).once.with_no_args
    plug.should_receive(:export_atc_classes).once.with_no_args
    plug.should_receive(:export_interactions).once.with_no_args
    plug.should_receive(:export_narcotics).once.with_no_args
    plug.should_receive(:export_prices).once.with_no_args
    plug.should_receive(:export_fachinfos).times(0).with_no_args
    plug.should_receive(:export_patinfos).once.with_no_args
    plug.should_receive(:export_doctors).times(0).with_no_args
  end
  assert_equal('sleep', @exporter.export_yaml)
end

- (Object) test_mail_download_invoices



375
376
377
378
379
380
# File 'test/test_util/exporter.rb', line 375

def test_mail_download_invoices
  flexstub(@plugin) do |plug|
    plug.should_receive(:run).and_return('run')
  end
  assert_equal('run', @exporter.mail_download_invoices)
end

- (Object) test_mail_download_stats



366
367
368
369
370
371
372
373
374
# File 'test/test_util/exporter.rb', line 366

def test_mail_download_stats
  flexstub(Log) do |logclass|
    # white box test: Log.new is once called in any case
    logclass.should_receive(:new).times(1).and_return(@log)
  end
  flexstub(File).should_receive(:read)
  flexstub(LogFile).should_receive(:filename).times(1).with('download', Date)
  assert_equal(nil, @exporter.mail_download_stats)
end

- (Object) test_mail_fachinfo_log__noreport



381
382
383
384
385
386
387
# File 'test/test_util/exporter.rb', line 381

def test_mail_fachinfo_log__noreport
  flexstub(@plugin) do |plug|
    plug.should_receive(:run)
    plug.should_receive(:report).and_return(nil)
  end
  assert_equal(nil, @exporter.mail_fachinfo_log)
end

- (Object) test_mail_fachinfo_log__report



388
389
390
391
392
393
394
395
396
397
398
# File 'test/test_util/exporter.rb', line 388

def test_mail_fachinfo_log__report
  flexstub(@plugin) do |plug|
    plug.should_receive(:run)
    plug.should_receive(:report).and_return('report')
  end
  flexstub(Log) do |logclass|
    # white box test: Log.new is once called if there is a report
    logclass.should_receive(:new).times(1).and_return(@log)
  end
  assert_equal(nil, @exporter.mail_fachinfo_log)
end

- (Object) test_mail_feedback_stats



400
401
402
403
404
405
406
407
408
# File 'test/test_util/exporter.rb', line 400

def test_mail_feedback_stats
  flexstub(Log) do |logclass|
    # white box test: Log.new is once called in any case
    logclass.should_receive(:new).times(1).and_return(@log)
  end
  flexstub(File).should_receive(:read)
  flexstub(LogFile).should_receive(:filename).times(1).with('feedback', Date)
  assert_equal(nil, @exporter.mail_feedback_stats)
end

- (Object) test_mail_notification_stats



409
410
411
412
413
414
415
416
417
418
419
420
421
# File 'test/test_util/exporter.rb', line 409

def test_mail_notification_stats
  flexstub(@app) do |app|
    app.should_receive(:"notification_logger.create_csv").and_return('file')
  end
  flexstub(@log) do |log|
    log.should_receive(:notify_attachment).with('file', Hash).and_return('notify_attachment')
  end
  flexstub(Log) do |logclass|
    # white box test: Log.new is once called
    logclass.should_receive(:new).times(1).and_return(@log)
  end
  assert_equal('notify_attachment', @exporter.mail_notification_stats)
end

- (Object) test_mail_patinfo_invoice



422
423
424
425
426
427
# File 'test/test_util/exporter.rb', line 422

def test_mail_patinfo_invoice
  flexstub(@plugin) do |plug|
    plug.should_receive(:run).and_return('run')
  end
  assert_equal('run', @exporter.mail_patinfo_invoices)
end

- (Object) test_mail_stats__after_8th



461
462
463
464
465
466
467
468
469
470
471
472
473
# File 'test/test_util/exporter.rb', line 461

def test_mail_stats__after_8th
  flexstub(@exporter, :today => Date.new(2011,1,10))
  flexstub(Log) do |logclass|
    # white box test: Log.new is once called in any case
    logclass.should_receive(:new).times(1).and_return(@log)
  end
  flexstub(File).should_receive(:read)

  # test
  expected_date = Date.new(2011,1,10)
  flexstub(LogFile).should_receive(:filename).with('key', expected_date)
  assert_equal(nil, @exporter.mail_stats('key'))
end

- (Object) test_mail_stats__before_8th



448
449
450
451
452
453
454
455
456
457
458
459
460
# File 'test/test_util/exporter.rb', line 448

def test_mail_stats__before_8th
  flexstub(@exporter, :today => Date.new(2011,1,5))
  flexstub(Log) do |logclass|
    # white box test: Log.new is once called in any case
    logclass.should_receive(:new).times(1).and_return(@log)
  end
  flexstub(File).should_receive(:read)

  # test
  expected_date = Date.new(2010,12,5)
  flexstub(LogFile).should_receive(:filename).with('key', expected_date)
  assert_equal(nil, @exporter.mail_stats('key'))
end

- (Object) test_mail_swissmedic_notifications



474
475
476
477
478
479
# File 'test/test_util/exporter.rb', line 474

def test_mail_swissmedic_notifications
  flexstub(@plugin) do |plug|
      plug.should_receive(:mail_notifications).and_return('mail_notifications')
  end
  assert_equal('mail_notifications', @exporter.mail_swissmedic_notifications)
end

- (Object) test_run__on_15th_day



109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
# File 'test/test_util/exporter.rb', line 109

def test_run__on_15th_day
  flexstub(@exporter) do  |exp|
    exp.should_receive(:today).and_return(Date.new(2011,1,15)) # Saturday
    exp.should_receive(:mail_patinfo_invoices).once.with_no_args
    exp.should_receive(:mail_fachinfo_log).once.with_no_args
    exp.should_receive(:mail_download_invoices).once.with_no_args
    exp.should_receive(:mail_download_stats).times(0).with_no_args
    exp.should_receive(:mail_feedback_stats).times(0).with_no_args
    exp.should_receive(:export_sl_pcodes).once.with_no_args
    exp.should_receive(:export_yaml).once.with_no_args
    exp.should_receive(:export_oddbdat).once.with_no_args
    exp.should_receive(:export_csv).once.with_no_args
    exp.should_receive(:export_doc_csv).once.with_no_args
    exp.should_receive(:export_index_therapeuticus_csv).once.with_no_args
    exp.should_receive(:export_price_history_csv).once.with_no_args
  end
  assert_equal(nil, @exporter.run)
end

- (Object) test_run__on_1st_day



90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
# File 'test/test_util/exporter.rb', line 90

def test_run__on_1st_day
  # totally whilte box test
  flexstub(@exporter) do  |exp|
    exp.should_receive(:today).and_return(Date.new(2011,1,1)) # Saturday
    exp.should_receive(:mail_patinfo_invoices).once.with_no_args
    exp.should_receive(:mail_fachinfo_log).once.with_no_args
    exp.should_receive(:mail_download_invoices).once.with_no_args
    exp.should_receive(:mail_download_stats).times(0).with_no_args
    exp.should_receive(:mail_feedback_stats).times(0).with_no_args
    exp.should_receive(:export_sl_pcodes).once.with_no_args
    exp.should_receive(:export_yaml).once.with_no_args
    exp.should_receive(:export_oddbdat).once.with_no_args
    exp.should_receive(:export_csv).once.with_no_args
    exp.should_receive(:export_doc_csv).once.with_no_args
    exp.should_receive(:export_index_therapeuticus_csv).once.with_no_args
    exp.should_receive(:export_price_history_csv).once.with_no_args
  end
  assert_equal(nil, @exporter.run)
end

- (Object) test_run__on_sunday



127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
# File 'test/test_util/exporter.rb', line 127

def test_run__on_sunday
  flexstub(@exporter) do  |exp|
    exp.should_receive(:today).and_return(Date.new(2011,1,2)) # Sunday
    exp.should_receive(:mail_patinfo_invoices).once.with_no_args
    exp.should_receive(:mail_fachinfo_log).once.with_no_args
    exp.should_receive(:mail_download_invoices).times(0).with_no_args
    exp.should_receive(:mail_download_stats).once.with_no_args
    exp.should_receive(:mail_feedback_stats).once.with_no_args
    exp.should_receive(:export_sl_pcodes).once.with_no_args
    exp.should_receive(:export_yaml).once.with_no_args
    exp.should_receive(:export_oddbdat).once.with_no_args
    exp.should_receive(:export_csv).once.with_no_args
    exp.should_receive(:export_doc_csv).once.with_no_args
    exp.should_receive(:export_index_therapeuticus_csv).once.with_no_args
    exp.should_receive(:export_price_history_csv).once.with_no_args
  end
  assert_equal(nil, @exporter.run)
end

- (Object) test_safe_export



480
481
482
483
484
485
486
487
488
# File 'test/test_util/exporter.rb', line 480

def test_safe_export
  flexstub(Log) do |logclass|
    # white box test: Log.new is never called if there is no error
    logclass.should_receive(:new).times(0).and_return(@log)
  end
  @exporter.safe_export('test_safe_export') do
    'no error'
  end
end

- (Object) test_safe_export__error



489
490
491
492
493
494
495
496
497
# File 'test/test_util/exporter.rb', line 489

def test_safe_export__error
  flexstub(Log) do |logclass|
    # white box test: Log.new is never called if there is no error
    logclass.should_receive(:new).times(1).and_return(@log)
  end
  @exporter.safe_export('test_safe_export') do
    raise
  end
end

- (Object) test_test



24
25
26
# File 'test/test_util/exporter.rb', line 24

def test_test
  assert(true)
end