From 1d486b38c4568ffa9531aa8e9f72ca8a5e7dca25 Mon Sep 17 00:00:00 2001 From: MSP-Greg Date: Fri, 17 Jan 2020 17:56:56 -0600 Subject: [PATCH] test for both 2.6.x and 2.6 --- __tests__/find-ruby.test.ts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/__tests__/find-ruby.test.ts b/__tests__/find-ruby.test.ts index fdbfa6a..08d5bb8 100644 --- a/__tests__/find-ruby.test.ts +++ b/__tests__/find-ruby.test.ts @@ -35,6 +35,22 @@ describe('find-ruby', () => { await findRubyVersion('17.0.0'); }); + it('Uses 9.0.x version of ruby installed in cache ', async () => { + const rubyDir: string = path.join(toolDir, 'Ruby', '9.0.1', os.arch()); + await io.mkdirP(rubyDir); + fs.writeFileSync(`${rubyDir}.complete`, 'hello'); + // This will throw if it doesn't find it in the cache (because no such version exists) + await findRubyVersion('9.0.x'); + }); + + it('Uses 9.0 version of ruby installed in cache ', async () => { + const rubyDir: string = path.join(toolDir, 'Ruby', '9.0.1', os.arch()); + await io.mkdirP(rubyDir); + fs.writeFileSync(`${rubyDir}.complete`, 'hello'); + // This will throw if it doesn't find it in the cache (because no such version exists) + await findRubyVersion('9.0'); + }); + it('findRubyVersion throws if cannot find any version of ruby', async () => { let thrown = false; try {