]> git.djapps.eu Git - pkg/ggml/sources/whisper.cpp/commitdiff
ruby : fix installation test (#2519)
authorKITAITI Makoto <redacted>
Tue, 29 Oct 2024 06:45:37 +0000 (15:45 +0900)
committerGitHub <redacted>
Tue, 29 Oct 2024 06:45:37 +0000 (08:45 +0200)
bindings/ruby/tests/test_package.rb

index 3183c2956e2b81d6e487babe4359aa0171684255..f51eab575d6e0a5d1a21057ec2cc555f966a4471 100644 (file)
@@ -18,11 +18,13 @@ class TestPackage < Test::Unit::TestCase
     end
 
     def test_install
-      filename = `rake -Tbuild`.match(/(whispercpp-(?:.+)\.gem)/)[1]
+      match_data = `rake -Tbuild`.match(/(whispercpp-(.+)\.gem)/)
+      filename = match_data[1]
+      version = match_data[2]
       basename = "whisper.#{RbConfig::CONFIG["DLEXT"]}"
       Dir.mktmpdir do |dir|
         system "gem", "install", "--install-dir", dir.shellescape, "pkg/#{filename.shellescape}", exception: true
-        assert_path_exist File.join(dir, "gems/whispercpp-1.3.0/lib", basename)
+        assert_path_exist File.join(dir, "gems/whispercpp-#{version}/lib", basename)
       end
     end
   end