@@ -8,7 +8,8 @@ class Propshaft::OutputPathTest < ActiveSupport::TestCase
8
8
setup do
9
9
@manifest = {
10
10
".manifest.json" : ".manifest.json" ,
11
- "one.txt" : "one-f2e1ec14.txt"
11
+ "one.txt" : "one-f2e1ec14.txt" ,
12
+ "one.txt.map" : "one-f2e1ec15.txt.map"
12
13
} . stringify_keys
13
14
@output_path = Propshaft ::OutputPath . new ( Pathname . new ( "#{ __dir__ } /../fixtures/output" ) , @manifest )
14
15
end
@@ -49,6 +50,19 @@ class Propshaft::OutputPathTest < ActiveSupport::TestCase
49
50
FileUtils . rm ( current ) if File . exist? ( current )
50
51
end
51
52
53
+ test "clean keeps the correct number of versions regardless of the file extension" do
54
+ old = output_asset ( "by_count.txt.map" , "old" , created_at : Time . now - 300 )
55
+ current = output_asset ( "by_count.txt.map" , "current" , created_at : Time . now - 180 )
56
+
57
+ @output_path . clean ( 1 , 0 )
58
+
59
+ assert File . exist? ( current )
60
+ assert_not File . exist? ( old )
61
+ ensure
62
+ FileUtils . rm ( old ) if File . exist? ( old )
63
+ FileUtils . rm ( current ) if File . exist? ( current )
64
+ end
65
+
52
66
test "clean keeps all versions under a certain age" do
53
67
old = output_asset ( "by_age.txt" , "old" )
54
68
current = output_asset ( "by_age.txt" , "current" )
0 commit comments