Skip to content

Commit aabe5f5

Browse files
Complete the changes needed to support ruby 3.3 and 3.4
1 parent c8d3c6b commit aabe5f5

File tree

2 files changed

+23
-1
lines changed

2 files changed

+23
-1
lines changed

lib/plugins/aws/invoke-local/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ class AwsInvokeLocal {
293293
);
294294
}
295295

296-
if (['ruby2.7', 'ruby3.2'].includes(runtime)) {
296+
if (['ruby2.7', 'ruby3.2', 'ruby3.3', 'ruby3.4'].includes(runtime)) {
297297
const handlerComponents = handler.split(/\./);
298298
const handlerPath = handlerComponents[0];
299299
const handlerName = handlerComponents.slice(1).join('.');

test/unit/lib/plugins/aws/invoke-local/index.test.js

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -489,6 +489,28 @@ describe('AwsInvokeLocal', () => {
489489
).to.be.equal(true);
490490
});
491491

492+
it('should call invokeLocalRuby when ruby3.3 runtime is set', async () => {
493+
awsInvokeLocal.options.functionObj.runtime = 'ruby3.3';
494+
await awsInvokeLocal.invokeLocal();
495+
// NOTE: this is important so that tests on Windows won't fail
496+
const runtime = process.platform === 'win32' ? 'ruby.exe' : 'ruby';
497+
expect(invokeLocalRubyStub.calledOnce).to.be.equal(true);
498+
expect(
499+
invokeLocalRubyStub.calledWithExactly(runtime, 'handler', 'hello', {}, undefined)
500+
).to.be.equal(true);
501+
});
502+
503+
it('should call invokeLocalRuby when ruby3.4 runtime is set', async () => {
504+
awsInvokeLocal.options.functionObj.runtime = 'ruby3.4';
505+
await awsInvokeLocal.invokeLocal();
506+
// NOTE: this is important so that tests on Windows won't fail
507+
const runtime = process.platform === 'win32' ? 'ruby.exe' : 'ruby';
508+
expect(invokeLocalRubyStub.calledOnce).to.be.equal(true);
509+
expect(
510+
invokeLocalRubyStub.calledWithExactly(runtime, 'handler', 'hello', {}, undefined)
511+
).to.be.equal(true);
512+
});
513+
492514
it('should call invokeLocalDocker if using runtime provided', async () => {
493515
awsInvokeLocal.options.functionObj.runtime = 'provided';
494516
awsInvokeLocal.options.functionObj.handler = 'handler.foobar';

0 commit comments

Comments
 (0)