Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/plugins/aws/invoke-local/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ class AwsInvokeLocal {
);
}

if (['ruby2.7', 'ruby3.2'].includes(runtime)) {
if (['ruby2.7', 'ruby3.2', 'ruby3.3', 'ruby3.4'].includes(runtime)) {
const handlerComponents = handler.split(/\./);
const handlerPath = handlerComponents[0];
const handlerName = handlerComponents.slice(1).join('.');
Expand Down
22 changes: 22 additions & 0 deletions test/unit/lib/plugins/aws/invoke-local/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -489,6 +489,28 @@ describe('AwsInvokeLocal', () => {
).to.be.equal(true);
});

it('should call invokeLocalRuby when ruby3.3 runtime is set', async () => {
awsInvokeLocal.options.functionObj.runtime = 'ruby3.3';
await awsInvokeLocal.invokeLocal();
// NOTE: this is important so that tests on Windows won't fail
const runtime = process.platform === 'win32' ? 'ruby.exe' : 'ruby';
expect(invokeLocalRubyStub.calledOnce).to.be.equal(true);
expect(
invokeLocalRubyStub.calledWithExactly(runtime, 'handler', 'hello', {}, undefined)
).to.be.equal(true);
});

it('should call invokeLocalRuby when ruby3.4 runtime is set', async () => {
awsInvokeLocal.options.functionObj.runtime = 'ruby3.4';
await awsInvokeLocal.invokeLocal();
// NOTE: this is important so that tests on Windows won't fail
const runtime = process.platform === 'win32' ? 'ruby.exe' : 'ruby';
expect(invokeLocalRubyStub.calledOnce).to.be.equal(true);
expect(
invokeLocalRubyStub.calledWithExactly(runtime, 'handler', 'hello', {}, undefined)
).to.be.equal(true);
});

it('should call invokeLocalDocker if using runtime provided', async () => {
awsInvokeLocal.options.functionObj.runtime = 'provided';
awsInvokeLocal.options.functionObj.handler = 'handler.foobar';
Expand Down