Add spec for getAspectRatio

This commit is contained in:
Kevin Sawicki 2016-10-05 09:21:28 -07:00
parent abffd98e29
commit 4ffae1d563

View file

@ -146,4 +146,11 @@ describe('nativeImage module', () => {
assert(!cropA.toPNG().equals(cropB.toPNG()))
})
})
describe('getAspectRatio()', () => {
it('returns the aspect ratio of the image', () => {
assert.equal(nativeImage.createEmpty().getAspectRatio(), 1.0)
assert.equal(nativeImage.createFromPath(path.join(__dirname, 'fixtures', 'assets', 'logo.png')).getAspectRatio(), 2.8315789699554443)
})
})
})