From 564fd87b9932b26a4bf5945f33b6eae32b5c7e73 Mon Sep 17 00:00:00 2001 From: Will Jessop Date: Sun, 14 Jul 2019 14:09:01 +0100 Subject: [PATCH] Different versions of ffprobe can return subtly different video lengths Specify a range so we can take this into account, but not get caught out by 0, nil or way too large values. --- activestorage/test/analyzer/video_analyzer_test.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/activestorage/test/analyzer/video_analyzer_test.rb b/activestorage/test/analyzer/video_analyzer_test.rb index 172a2f0aae..57e094908a 100644 --- a/activestorage/test/analyzer/video_analyzer_test.rb +++ b/activestorage/test/analyzer/video_analyzer_test.rb @@ -13,7 +13,7 @@ class ActiveStorage::Analyzer::VideoAnalyzerTest < ActiveSupport::TestCase assert_equal 640, metadata[:width] assert_equal 480, metadata[:height] assert_equal [4, 3], metadata[:display_aspect_ratio] - assert_equal 5.166648, metadata[:duration] + assert_equal true, metadata[:duration].between?(4, 6) assert_not_includes metadata, :angle end