|
14 | 14 | File.join(DATA_DIR, 'file_types/receipt.jpg') |
15 | 15 | ) |
16 | 16 | expect(input_source.file_mimetype).to eq('image/jpeg') |
| 17 | + expect(input_source.filename).to eq('receipt.jpg') |
17 | 18 | expect(input_source.page_count).to eq(1) |
18 | 19 | expect(input_source.pdf?).to eq(false) |
19 | 20 |
|
20 | 21 | input_source = Mindee::Input::Source::PathInputSource.new( |
21 | 22 | File.join(DATA_DIR, 'file_types/receipt.jpga') |
22 | 23 | ) |
23 | 24 | expect(input_source.file_mimetype).to eq('image/jpeg') |
| 25 | + expect(input_source.filename).to eq('receipt.jpga') |
24 | 26 | expect(input_source.page_count).to eq(1) |
25 | 27 | expect(input_source.pdf?).to eq(false) |
26 | 28 | end |
|
30 | 32 | File.join(DATA_DIR, 'file_types/receipt.tif') |
31 | 33 | ) |
32 | 34 | expect(input_source.file_mimetype).to eq('image/tiff') |
| 35 | + expect(input_source.filename).to eq('receipt.tif') |
33 | 36 | expect(input_source.page_count).to eq(1) |
34 | 37 | expect(input_source.pdf?).to eq(false) |
35 | 38 |
|
36 | 39 | input_source = Mindee::Input::Source::PathInputSource.new( |
37 | 40 | File.join(DATA_DIR, 'file_types/receipt.tiff') |
38 | 41 | ) |
39 | 42 | expect(input_source.file_mimetype).to eq('image/tiff') |
| 43 | + expect(input_source.filename).to eq('receipt.tiff') |
40 | 44 | expect(input_source.page_count).to eq(1) |
41 | 45 | expect(input_source.pdf?).to eq(false) |
42 | 46 | end |
|
46 | 50 | File.join(DATA_DIR, 'file_types/receipt.heic') |
47 | 51 | ) |
48 | 52 | expect(input_source.file_mimetype).to eq('image/heic') |
| 53 | + expect(input_source.filename).to eq('receipt.heic') |
49 | 54 | expect(input_source.page_count).to eq(1) |
50 | 55 | expect(input_source.pdf?).to eq(false) |
51 | 56 | end |
|
57 | 62 | File.join(DATA_DIR, 'products/invoices/invoice.pdf') |
58 | 63 | ) |
59 | 64 | expect(input_source.file_mimetype).to eq('application/pdf') |
| 65 | + expect(input_source.filename).to eq('invoice.pdf') |
60 | 66 | expect(input_source.page_count).to eq(2) |
61 | 67 | expect(input_source.pdf?).to eq(true) |
62 | 68 |
|
63 | 69 | input_source = Mindee::Input::Source::PathInputSource.new( |
64 | 70 | File.join(DATA_DIR, 'products/invoices/invoice.pdf') |
65 | 71 | ) |
66 | 72 | expect(input_source.file_mimetype).to eq('application/pdf') |
| 73 | + expect(input_source.filename).to eq('invoice.pdf') |
67 | 74 | expect(input_source.page_count).to eq(2) |
68 | 75 | expect(input_source.pdf?).to eq(true) |
69 | 76 |
|
70 | 77 | input_source = Mindee::Input::Source::PathInputSource.new( |
71 | 78 | File.join(DATA_DIR, 'products/invoices/invoice_10p.pdf') |
72 | 79 | ) |
73 | 80 | expect(input_source.file_mimetype).to eq('application/pdf') |
| 81 | + expect(input_source.filename).to eq('invoice_10p.pdf') |
74 | 82 | expect(input_source.page_count).to eq(10) |
75 | 83 | expect(input_source.pdf?).to eq(true) |
76 | 84 | end |
|
0 commit comments