Skip to content

Commit 8e98e19

Browse files
kk-minypwong99
authored andcommitted
Add unit test for generating Ruby ZIP artifact
1 parent dd1668e commit 8e98e19

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/setup/deployment/packaging/test/zip_test.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,17 @@ func (s *ZipTestSuite) TestGenerateServerlessZipArtifactsNode() {
8383
assert.InDelta(s.T(), 50, util.BytesToMB(fileInfo.Size()), 0.1)
8484
}
8585

86+
func (s *ZipTestSuite) TestGenerateServerlessZipArtifactsRuby() {
87+
b := &building.Builder{}
88+
b.BuildFunction("aws", "helloruby", "ruby3.2")
89+
packaging.GenerateServerlessZIPArtifacts(2, "aws", "ruby3.2", "helloruby", 50)
90+
fileInfo, err := os.Stat("setup/deployment/raw-code/serverless/aws/artifacts/helloruby/helloruby.zip")
91+
if err != nil {
92+
assert.Fail(s.T(), "Could not obtain file info of ZIP artifact")
93+
}
94+
assert.InDelta(s.T(), 50, util.BytesToMB(fileInfo.Size()), 0.1)
95+
}
96+
8697
func TestZipTestSuite(t *testing.T) {
8798
suite.Run(t, new(ZipTestSuite))
8899
}

0 commit comments

Comments
 (0)