File tree 1 file changed +5
-2
lines changed
1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -33,8 +33,9 @@ def setup
33
33
# Mock Rails.env
34
34
Rails . stubs ( :env ) . returns ( ActiveSupport ::StringInquirer . new ( "development" ) )
35
35
36
- # Reset thread variable
37
- Thread . current [ :vite_manifest ] = nil
36
+ # Reset class variables in ViewHelper
37
+ ViteRailsLink ::ViewHelper . class_variable_set ( :@@vite_manifest , nil )
38
+ ViteRailsLink ::ViewHelper . class_variable_set ( :@@manifest_last_modified , nil )
38
39
end
39
40
40
41
def test_vite_manifest
@@ -55,6 +56,8 @@ def test_vite_manifest
55
56
end
56
57
57
58
def test_vite_manifest_file_not_found
59
+ # Mock both File.exist? and File.read
60
+ File . stubs ( :exist? ) . with ( @manifest_path ) . returns ( true )
58
61
File . stubs ( :read ) . with ( @manifest_path ) . raises ( Errno ::ENOENT . new ( "File not found" ) )
59
62
60
63
error = assert_raises ( Errno ::ENOENT ) do
You can’t perform that action at this time.
0 commit comments