| |   |
| 1 | ======== /home/janfri/test_photos/2008-02-16_0013.jpe |
| 2 | ExifToolVersion 7.03 |
| 3 | FileName 2008-02-16_0013.jpe |
| 4 | Directory /home/janfri/test_photos |
| 5 | FileSize 2 MB |
| 6 | FileModifyDate 2008:02:16 16:10:54 |
| 7 | FileType JPEG |
| 8 | MIMEType image/jpeg |
| 9 | ExifByteOrder Big-endian (Motorola) |
| 10 | ImageDescription KONICA MINOLTA DIGITAL CAMERA |
| 11 | Make KONICA MINOLTA |
| 12 | Model DYNAX 7D |
| 13 | Orientation Horizontal (normal) |
| 14 | XResolution 72 |
| 15 | YResolution 72 |
| 16 | ResolutionUnit inches |
| 17 | Software DYNAX 7D v1.10 |
| 18 | ModifyDate 2008:02:16 16:10:52 |
| 19 | YCbCrPositioning Centered |
| 20 | ExposureTime 1/250 |
| 21 | FNumber 6.7 |
| 22 | ExposureProgram Aperture-priority AE |
| 23 | ISO 100 |
| 24 | ExifVersion 0221 |
| 25 | DateTimeOriginal 2008:02:16 16:10:52 |
| 26 | CreateDate 2008:02:16 16:10:52 |
| 27 | ComponentsConfiguration YCbCr |
| 28 | BrightnessValue 8.5 |
| 29 | ExposureCompensation 0 |
| 30 | MaxApertureValue 6.7 |
| 31 | MeteringMode Center-weighted average |
| 32 | LightSource Unknown (0) |
| 33 | Flash Off |
| 34 | FocalLength 300.0mm |
| 35 | SubjectLocation 1504 1000 256 304 |
| 36 | MakerNoteVersion MLT0 |
| 37 | MinoltaImageSize Large |
| 38 | WhiteBalance Auto |
| 39 | FocusMode Single-shot AF |
| 40 | AFPoints Center |
| 41 | ISOSetting Auto |
| 42 | FreeMemoryCardImages 49 |
| 43 | Rotation Horizontal (normal) |
| 44 | ImageNumber 6 |
| 45 | NoiseReduction Unknown (2) |
| 46 | ImageNumber2 304 |
| 47 | ZoneMatchingOn Off |
| 48 | CompressedImageSize 2322879 |
| 49 | PreviewImageStart 2372611 |
| 50 | PreviewImageLength 46166 |
| 51 | SceneMode Standard |
| 52 | ColorMode Adobe RGB |
| 53 | MinoltaQuality Fine |
| 54 | FlashExposureComp 0 |
| 55 | ImageStabilization On |
| 56 | ZoneMatching ISO Setting Used |
| 57 | ColorTemperature 0 |
| 58 | LensID Tamron 18-200, 28-300 or 80-300mm F3.5-6.3 |
| 59 | UserComment |
| 60 | FlashpixVersion 0100 |
| 61 | ColorSpace Uncalibrated |
| 62 | ExifImageWidth 3008 |
| 63 | ExifImageLength 2000 |
| 64 | InteropIndex R98 - DCF basic file (sRGB) |
| 65 | InteropVersion 0100 |
| 66 | CustomRendered Normal |
| 67 | ExposureMode Auto |
| 68 | DigitalZoomRatio 0 |
| 69 | FocalLengthIn35mmFormat 450mm |
| 70 | SceneCaptureType Standard |
| 71 | GainControl None |
| 72 | Contrast Normal |
| 73 | Saturation Normal |
| 74 | Sharpness Normal |
| 75 | Compression JPEG (old-style) |
| 76 | ThumbnailOffset 40306 |
| 77 | ThumbnailLength 3729 |
| 78 | ProfileCMMType Win |
| 79 | ProfileVersion 2.2.0 |
| 80 | ProfileClass Display Device Profile |
| 81 | ColorSpaceData RGB |
| 82 | ProfileConnectionSpace XYZ |
| 83 | ProfileDateTime 2002:05:09 20:45:47 |
| 84 | ProfileFileSignature acsp |
| 85 | PrimaryPlatform Microsoft Corporation |
| 86 | CMMFlags Not Embedded, Independent |
| 87 | DeviceManufacturer KMHD |
| 88 | DeviceModel |
| 89 | DeviceAttributes Reflective, Glossy, Positive, Color |
| 90 | RenderingIntent Perceptual |
| 91 | ConnectionSpaceIlluminant 0.96419 1 0.82487 |
| 92 | ProfileCreator KMHD |
| 93 | ProfileID 0 |
| 94 | ProfileCopyright Copyright 2002 Minolta Co.,Ltd. |
| 95 | ProfileDescription AdobeRGB1998 ((KONICA MINOLTA CAM |
| 96 | GreenTRC (Binary data 1036 bytes, use -b option to extract) |
| 97 | RedTRC (Binary data 1036 bytes, use -b option to extract) |
| 98 | BlueTRC (Binary data 1036 bytes, use -b option to extract) |
| 99 | RedMatrixColumn 0.6097 0.3111 0.01949 |
| 100 | GreenMatrixColumn 0.20529 0.62569 0.0609 |
| 101 | BlueMatrixColumn 0.14919 0.06319 0.7446 |
| 102 | MediaWhitePoint 0.95045 1 1.08905 |
| 103 | ImageWidth 3008 |
| 104 | ImageHeight 2000 |
| 105 | EncodingProcess Baseline DCT, Huffman coding |
| 106 | BitsPerSample 8 |
| 107 | ColorComponents 3 |
| 108 | YCbCrSubSampling YCbCr4:2:2 (2 1) |
| 109 | Aperture 6.7 |
| 110 | ImageSize 3008x2000 |
| 111 | PreviewImage (Binary data 46166 bytes, use -b option to extract) |
| 112 | ScaleFactor35efl 1.5 |
| 113 | ShutterSpeed 1/250 |
| 114 | ThumbnailImage (Binary data 3729 bytes, use -b option to extract) |
| 115 | CircleOfConfusion 0.020 mm |
| 116 | FocalLength35efl 300.0mm (35mm equivalent: 450.0mm) |
| 117 | HyperfocalDistance 670.61 m |
| 118 | LightValue 13.5 |
| 119 | ======== /home/janfri/test_photos/2008-03-01_0004.jpg |
| 120 | ExifToolVersion 7.03 |
| 121 | FileName 2008-03-01_0004.jpg |
| 122 | Directory /home/janfri/test_photos |
| 123 | FileSize 2 MB |
| 124 | FileModifyDate 2008:03:13 17:47:05 |
| 125 | FileType JPEG |
| 126 | MIMEType image/jpeg |
| 127 | ExifByteOrder Big-endian (Motorola) |
| 128 | ImageDescription KONICA MINOLTA DIGITAL CAMERA |
| 129 | Make KONICA MINOLTA |
| 130 | Model DYNAX 7D |
| 131 | Orientation Horizontal (normal) |
| 132 | XResolution 72 |
| 133 | YResolution 72 |
| 134 | ResolutionUnit inches |
| 135 | Software DYNAX 7D v1.10 |
| 136 | ModifyDate 2008:03:01 13:23:22 |
| 137 | YCbCrPositioning Centered |
| 138 | ExposureTime 1/60 |
| 139 | FNumber 4.5 |
| 140 | ExposureProgram Program AE |
| 141 | ISO 400 |
| 142 | ExifVersion 0221 |
| 143 | DateTimeOriginal 2008:03:01 13:23:22 |
| 144 | CreateDate 2008:03:01 13:23:22 |
| 145 | ComponentsConfiguration YCbCr |
| 146 | BrightnessValue 3.5 |
| 147 | ExposureCompensation 0 |
| 148 | MaxApertureValue 4.5 |
| 149 | MeteringMode Center-weighted average |
| 150 | LightSource Unknown (0) |
| 151 | Flash On |
| 152 | FocalLength 75.0mm |
| 153 | SubjectLocation 1504 1000 256 304 |
| 154 | MakerNoteVersion MLT0 |
| 155 | MinoltaImageSize Large |
| 156 | WhiteBalance Auto |
| 157 | FocusMode Single-shot AF |
| 158 | AFPoints Center |
| 159 | ISOSetting Auto |
| 160 | FreeMemoryCardImages 15 |
| 161 | Rotation Rotate 270 CW |
| 162 | ImageNumber 6 |
| 163 | NoiseReduction Unknown (2) |
| 164 | ImageNumber2 304 |
| 165 | ZoneMatchingOn Off |
| 166 | CompressedImageSize 2191918 |
| 167 | PreviewImageStart 2241539 |
| 168 | PreviewImageLength 35524 |
| 169 | SceneMode Standard |
| 170 | ColorMode Natural sRGB |
| 171 | MinoltaQuality Fine |
| 172 | FlashExposureComp 0 |
| 173 | ImageStabilization On |
| 174 | ZoneMatching ISO Setting Used |
| 175 | ColorTemperature 0 |
| 176 | LensID Tamron 18-200, 28-300 or 80-300mm F3.5-6.3 |
| 177 | UserComment |
| 178 | FlashpixVersion 0100 |
| 179 | ColorSpace sRGB |
| 180 | ExifImageWidth 3008 |
| 181 | ExifImageLength 2000 |
| 182 | InteropIndex R98 - DCF basic file (sRGB) |
| 183 | InteropVersion 0100 |
| 184 | CustomRendered Normal |
| 185 | ExposureMode Auto |
| 186 | DigitalZoomRatio 0 |
| 187 | FocalLengthIn35mmFormat 112mm |
| 188 | SceneCaptureType Standard |
| 189 | GainControl Low gain up |
| 190 | Contrast Normal |
| 191 | Saturation Normal |
| 192 | Sharpness Normal |
| 193 | Compression JPEG (old-style) |
| 194 | ThumbnailOffset 40306 |
| 195 | ThumbnailLength 3420 |
| 196 | ImageWidth 3008 |
| 197 | ImageHeight 2000 |
| 198 | EncodingProcess Baseline DCT, Huffman coding |
| 199 | BitsPerSample 8 |
| 200 | ColorComponents 3 |
| 201 | YCbCrSubSampling YCbCr4:2:2 (2 1) |
| 202 | Aperture 4.5 |
| 203 | ImageSize 3008x2000 |
| 204 | PreviewImage (Binary data 35524 bytes, use -b option to extract) |
| 205 | ScaleFactor35efl 1.5 |
| 206 | ShutterSpeed 1/60 |
| 207 | ThumbnailImage (Binary data 3420 bytes, use -b option to extract) |
| 208 | CircleOfConfusion 0.020 mm |
| 209 | FocalLength35efl 75.0mm (35mm equivalent: 112.0mm) |
| 210 | HyperfocalDistance 62.13 m |
| 211 | LightValue 8.2 |
| 212 | 2 image files read |
| toggle raw diff |
--- /dev/null
+++ b/data/fixtures/read_two_files.stdout
@@ -0,0 +1,212 @@
+======== /home/janfri/test_photos/2008-02-16_0013.jpe
+ExifToolVersion 7.03
+FileName 2008-02-16_0013.jpe
+Directory /home/janfri/test_photos
+FileSize 2 MB
+FileModifyDate 2008:02:16 16:10:54
+FileType JPEG
+MIMEType image/jpeg
+ExifByteOrder Big-endian (Motorola)
+ImageDescription KONICA MINOLTA DIGITAL CAMERA
+Make KONICA MINOLTA
+Model DYNAX 7D
+Orientation Horizontal (normal)
+XResolution 72
+YResolution 72
+ResolutionUnit inches
+Software DYNAX 7D v1.10
+ModifyDate 2008:02:16 16:10:52
+YCbCrPositioning Centered
+ExposureTime 1/250
+FNumber 6.7
+ExposureProgram Aperture-priority AE
+ISO 100
+ExifVersion 0221
+DateTimeOriginal 2008:02:16 16:10:52
+CreateDate 2008:02:16 16:10:52
+ComponentsConfiguration YCbCr
+BrightnessValue 8.5
+ExposureCompensation 0
+MaxApertureValue 6.7
+MeteringMode Center-weighted average
+LightSource Unknown (0)
+Flash Off
+FocalLength 300.0mm
+SubjectLocation 1504 1000 256 304
+MakerNoteVersion MLT0
+MinoltaImageSize Large
+WhiteBalance Auto
+FocusMode Single-shot AF
+AFPoints Center
+ISOSetting Auto
+FreeMemoryCardImages 49
+Rotation Horizontal (normal)
+ImageNumber 6
+NoiseReduction Unknown (2)
+ImageNumber2 304
+ZoneMatchingOn Off
+CompressedImageSize 2322879
+PreviewImageStart 2372611
+PreviewImageLength 46166
+SceneMode Standard
+ColorMode Adobe RGB
+MinoltaQuality Fine
+FlashExposureComp 0
+ImageStabilization On
+ZoneMatching ISO Setting Used
+ColorTemperature 0
+LensID Tamron 18-200, 28-300 or 80-300mm F3.5-6.3
+UserComment
+FlashpixVersion 0100
+ColorSpace Uncalibrated
+ExifImageWidth 3008
+ExifImageLength 2000
+InteropIndex R98 - DCF basic file (sRGB)
+InteropVersion 0100
+CustomRendered Normal
+ExposureMode Auto
+DigitalZoomRatio 0
+FocalLengthIn35mmFormat 450mm
+SceneCaptureType Standard
+GainControl None
+Contrast Normal
+Saturation Normal
+Sharpness Normal
+Compression JPEG (old-style)
+ThumbnailOffset 40306
+ThumbnailLength 3729
+ProfileCMMType Win
+ProfileVersion 2.2.0
+ProfileClass Display Device Profile
+ColorSpaceData RGB
+ProfileConnectionSpace XYZ
+ProfileDateTime 2002:05:09 20:45:47
+ProfileFileSignature acsp
+PrimaryPlatform Microsoft Corporation
+CMMFlags Not Embedded, Independent
+DeviceManufacturer KMHD
+DeviceModel
+DeviceAttributes Reflective, Glossy, Positive, Color
+RenderingIntent Perceptual
+ConnectionSpaceIlluminant 0.96419 1 0.82487
+ProfileCreator KMHD
+ProfileID 0
+ProfileCopyright Copyright 2002 Minolta Co.,Ltd.
+ProfileDescription AdobeRGB1998 ((KONICA MINOLTA CAM
+GreenTRC (Binary data 1036 bytes, use -b option to extract)
+RedTRC (Binary data 1036 bytes, use -b option to extract)
+BlueTRC (Binary data 1036 bytes, use -b option to extract)
+RedMatrixColumn 0.6097 0.3111 0.01949
+GreenMatrixColumn 0.20529 0.62569 0.0609
+BlueMatrixColumn 0.14919 0.06319 0.7446
+MediaWhitePoint 0.95045 1 1.08905
+ImageWidth 3008
+ImageHeight 2000
+EncodingProcess Baseline DCT, Huffman coding
+BitsPerSample 8
+ColorComponents 3
+YCbCrSubSampling YCbCr4:2:2 (2 1)
+Aperture 6.7
+ImageSize 3008x2000
+PreviewImage (Binary data 46166 bytes, use -b option to extract)
+ScaleFactor35efl 1.5
+ShutterSpeed 1/250
+ThumbnailImage (Binary data 3729 bytes, use -b option to extract)
+CircleOfConfusion 0.020 mm
+FocalLength35efl 300.0mm (35mm equivalent: 450.0mm)
+HyperfocalDistance 670.61 m
+LightValue 13.5
+======== /home/janfri/test_photos/2008-03-01_0004.jpg
+ExifToolVersion 7.03
+FileName 2008-03-01_0004.jpg
+Directory /home/janfri/test_photos
+FileSize 2 MB
+FileModifyDate 2008:03:13 17:47:05
+FileType JPEG
+MIMEType image/jpeg
+ExifByteOrder Big-endian (Motorola)
+ImageDescription KONICA MINOLTA DIGITAL CAMERA
+Make KONICA MINOLTA
+Model DYNAX 7D
+Orientation Horizontal (normal)
+XResolution 72
+YResolution 72
+ResolutionUnit inches
+Software DYNAX 7D v1.10
+ModifyDate 2008:03:01 13:23:22
+YCbCrPositioning Centered
+ExposureTime 1/60
+FNumber 4.5
+ExposureProgram Program AE
+ISO 400
+ExifVersion 0221
+DateTimeOriginal 2008:03:01 13:23:22
+CreateDate 2008:03:01 13:23:22
+ComponentsConfiguration YCbCr
+BrightnessValue 3.5
+ExposureCompensation 0
+MaxApertureValue 4.5
+MeteringMode Center-weighted average
+LightSource Unknown (0)
+Flash On
+FocalLength 75.0mm
+SubjectLocation 1504 1000 256 304
+MakerNoteVersion MLT0
+MinoltaImageSize Large
+WhiteBalance Auto
+FocusMode Single-shot AF
+AFPoints Center
+ISOSetting Auto
+FreeMemoryCardImages 15
+Rotation Rotate 270 CW
+ImageNumber 6
+NoiseReduction Unknown (2)
+ImageNumber2 304
+ZoneMatchingOn Off
+CompressedImageSize 2191918
+PreviewImageStart 2241539
+PreviewImageLength 35524
+SceneMode Standard
+ColorMode Natural sRGB
+MinoltaQuality Fine
+FlashExposureComp 0
+ImageStabilization On
+ZoneMatching ISO Setting Used
+ColorTemperature 0
+LensID Tamron 18-200, 28-300 or 80-300mm F3.5-6.3
+UserComment
+FlashpixVersion 0100
+ColorSpace sRGB
+ExifImageWidth 3008
+ExifImageLength 2000
+InteropIndex R98 - DCF basic file (sRGB)
+InteropVersion 0100
+CustomRendered Normal
+ExposureMode Auto
+DigitalZoomRatio 0
+FocalLengthIn35mmFormat 112mm
+SceneCaptureType Standard
+GainControl Low gain up
+Contrast Normal
+Saturation Normal
+Sharpness Normal
+Compression JPEG (old-style)
+ThumbnailOffset 40306
+ThumbnailLength 3420
+ImageWidth 3008
+ImageHeight 2000
+EncodingProcess Baseline DCT, Huffman coding
+BitsPerSample 8
+ColorComponents 3
+YCbCrSubSampling YCbCr4:2:2 (2 1)
+Aperture 4.5
+ImageSize 3008x2000
+PreviewImage (Binary data 35524 bytes, use -b option to extract)
+ScaleFactor35efl 1.5
+ShutterSpeed 1/60
+ThumbnailImage (Binary data 3420 bytes, use -b option to extract)
+CircleOfConfusion 0.020 mm
+FocalLength35efl 75.0mm (35mm equivalent: 112.0mm)
+HyperfocalDistance 62.13 m
+LightValue 8.2
+ 2 image files read |
| |   |
| 2 | 2 | |
| 3 | 3 | module Parser |
| 4 | 4 | |
| 5 | # :stopdoc: |
| 5 | 6 | REGEXP_TAGLINE = /^(\w+)\t(.*)$/.freeze |
| 6 | | REGEXP_STRIPLINE = /^={8} / |
| 7 | | |
| 7 | REGEXP_STRIPLINE = /^={8} /.freeze |
| 8 | # :startdoc: |
| 8 | 9 | |
| 9 | 10 | def self.parse stdout, stderr |
| 10 | 11 | result = [] |
| … | … | |
| 16 | 16 | when REGEXP_TAGLINE |
| 17 | 17 | image_info[$1] = $2 |
| 18 | 18 | when REGEXP_STRIPLINE |
| 19 | | result << image_info unless image_info.empty? |
| 19 | unless image_info.empty? |
| 20 | result << Result.new(image_info, {}) |
| 21 | end |
| 20 | 22 | image_info.clear |
| 21 | 23 | end |
| 22 | 24 | end |
| 23 | | result << image_info unless image_info.empty? |
| 25 | unless image_info.empty? |
| 26 | result << Result.new(image_info, {}) |
| 27 | end |
| 24 | 28 | result |
| 25 | 29 | end |
| 26 | 30 | |
| … | … | |
| 33 | 33 | attr_reader :data, :errors |
| 34 | 34 | |
| 35 | 35 | def initialize data, errors |
| 36 | | @data, @errors = data, errors |
| 36 | @data, @errors = data.clone.freeze, errors.clone.freeze |
| 37 | 37 | end |
| 38 | 38 | |
| 39 | 39 | end |
| toggle raw diff |
--- a/lib/multi_exiftool/parser.rb
+++ b/lib/multi_exiftool/parser.rb
@@ -2,9 +2,10 @@ module MultiExiftool
module Parser
+ # :stopdoc:
REGEXP_TAGLINE = /^(\w+)\t(.*)$/.freeze
- REGEXP_STRIPLINE = /^={8} /
-
+ REGEXP_STRIPLINE = /^={8} /.freeze
+ # :startdoc:
def self.parse stdout, stderr
result = []
@@ -15,11 +16,15 @@ module MultiExiftool
when REGEXP_TAGLINE
image_info[$1] = $2
when REGEXP_STRIPLINE
- result << image_info unless image_info.empty?
+ unless image_info.empty?
+ result << Result.new(image_info, {})
+ end
image_info.clear
end
end
- result << image_info unless image_info.empty?
+ unless image_info.empty?
+ result << Result.new(image_info, {})
+ end
result
end
@@ -28,7 +33,7 @@ module MultiExiftool
attr_reader :data, :errors
def initialize data, errors
- @data, @errors = data, errors
+ @data, @errors = data.clone.freeze, errors.clone.freeze
end
end |
| |   |
| 4 | 4 | |
| 5 | 5 | describe 'parse' do |
| 6 | 6 | |
| 7 | | it 'should return an empty array when trying to read from a non-existing file' do |
| 8 | | fix = Fixture.read_non_existing_file |
| 9 | | Parser.parse(fix.stdout, fix.stderr).should == [] |
| 7 | describe 'read_non_existing_file' do |
| 8 | |
| 9 | it 'should return an empty array' do |
| 10 | fix = Fixture.read_non_existing_file |
| 11 | Parser.parse(fix.stdout, fix.stderr).should == [] |
| 12 | end |
| 13 | |
| 10 | 14 | end |
| 11 | 15 | |
| 12 | | describe 'reading one file' do |
| 16 | describe 'read_one_file' do |
| 13 | 17 | |
| 14 | 18 | before :all do |
| 15 | 19 | fix = Fixture.read_one_file |
| 16 | 20 | @result = Parser.parse(fix.stdout, fix.stderr) |
| 17 | 21 | end |
| 18 | 22 | |
| 19 | | it 'should return an array with one result' do |
| 23 | it 'should return an array with one result of meaningful data' do |
| 20 | 24 | @result.should be_kind_of(Array) |
| 21 | 25 | @result.size.should == 1 |
| 26 | data = @result.first.data |
| 27 | data['DateTimeOriginal'].should == '2005:10:06 15:41:08' |
| 28 | data['FNumber'].should == '9.0' |
| 29 | end |
| 30 | |
| 31 | end |
| 32 | |
| 33 | describe 'read_two_files' do |
| 34 | |
| 35 | before :all do |
| 36 | fix = Fixture.read_two_files |
| 37 | @result = Parser.parse(fix.stdout, fix.stderr) |
| 38 | end |
| 39 | |
| 40 | it 'should return an array with two results of meaningful data' do |
| 41 | @result.should be_kind_of(Array) |
| 42 | @result.size.should == 2 |
| 43 | data1 = @result[0].data |
| 44 | data1['DateTimeOriginal'].should == '2008:02:16 16:10:52' |
| 45 | data1['FNumber'].should == '6.7' |
| 46 | data2 = @result[1].data |
| 47 | data2['DateTimeOriginal'].should == '2008:03:01 13:23:22' |
| 48 | data2['FNumber'].should == '4.5' |
| 22 | 49 | end |
| 23 | 50 | |
| 24 | 51 | end |
| toggle raw diff |
--- a/spec/parser_spec.rb
+++ b/spec/parser_spec.rb
@@ -4,21 +4,48 @@ describe MultiExiftool::Parser do
describe 'parse' do
- it 'should return an empty array when trying to read from a non-existing file' do
- fix = Fixture.read_non_existing_file
- Parser.parse(fix.stdout, fix.stderr).should == []
+ describe 'read_non_existing_file' do
+
+ it 'should return an empty array' do
+ fix = Fixture.read_non_existing_file
+ Parser.parse(fix.stdout, fix.stderr).should == []
+ end
+
end
- describe 'reading one file' do
+ describe 'read_one_file' do
before :all do
fix = Fixture.read_one_file
@result = Parser.parse(fix.stdout, fix.stderr)
end
- it 'should return an array with one result' do
+ it 'should return an array with one result of meaningful data' do
@result.should be_kind_of(Array)
@result.size.should == 1
+ data = @result.first.data
+ data['DateTimeOriginal'].should == '2005:10:06 15:41:08'
+ data['FNumber'].should == '9.0'
+ end
+
+ end
+
+ describe 'read_two_files' do
+
+ before :all do
+ fix = Fixture.read_two_files
+ @result = Parser.parse(fix.stdout, fix.stderr)
+ end
+
+ it 'should return an array with two results of meaningful data' do
+ @result.should be_kind_of(Array)
+ @result.size.should == 2
+ data1 = @result[0].data
+ data1['DateTimeOriginal'].should == '2008:02:16 16:10:52'
+ data1['FNumber'].should == '6.7'
+ data2 = @result[1].data
+ data2['DateTimeOriginal'].should == '2008:03:01 13:23:22'
+ data2['FNumber'].should == '4.5'
end
end |