From 039f996ef1a10420f1eb47df4eb942ae6b519e24 Mon Sep 17 00:00:00 2001 From: Rylan Collins Date: Wed, 22 Jul 2020 12:44:35 -0700 Subject: [PATCH] test: add test for prerelease version.rb verification --- src/__tests__/verifyConditions.test.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/__tests__/verifyConditions.test.js b/src/__tests__/verifyConditions.test.js index 2391ce2..9e7ed00 100644 --- a/src/__tests__/verifyConditions.test.js +++ b/src/__tests__/verifyConditions.test.js @@ -57,6 +57,18 @@ it('verifies the version file', async () => { expect(versionFile).toEqual('lib/test-gem/version.rb'); }); +describe('when the existing version file contains a prerelease version', () => { + it('verifies the version file', async () => { + const cwd = path.resolve(__dirname, './fixtures/prerelease'); + const { versionFile } = await verifyConditions( + {}, + { cwd, env: defaultEnv }, + { credentialsFile }, + ); + expect(versionFile).toEqual('lib/test-gem/version.rb'); + }); +}); + describe('when there is no version file', () => { it('throws an error', async () => { const cwd = path.resolve(__dirname, './fixtures/no-version-file');