From 4ffae1d563abaf79fa4980e5a6899b7ddced35be Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Wed, 5 Oct 2016 09:21:28 -0700 Subject: [PATCH] Add spec for getAspectRatio --- spec/api-native-image-spec.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/spec/api-native-image-spec.js b/spec/api-native-image-spec.js index de96217dd1d..3ee5e55c25c 100644 --- a/spec/api-native-image-spec.js +++ b/spec/api-native-image-spec.js @@ -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) + }) + }) })