File tree 1 file changed +5
-5
lines changed
1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change 69
69
cached_s = cached . to_s
70
70
expect ( FileTest ) . to receive ( :file? ) . with ( cached_s ) . and_return ( false )
71
71
expect ( FileTest ) . not_to receive ( :size? ) . with ( cached_s )
72
- expect ( FileUtils ) . to receive ( :mv ) . with ( anything , tmp_file )
72
+ expect ( FileUtils ) . to receive ( :mv ) . with ( optimized , tmp_file )
73
73
expect ( tmp_file ) . to receive ( :rename ) . with ( cached )
74
74
75
75
expect ( cache . fetch ( original ) { optimized } ) . to eq ( cached )
79
79
cached_s = cached . to_s
80
80
expect ( FileTest ) . to receive ( :file? ) . with ( cached_s ) . and_return ( false )
81
81
expect ( FileTest ) . not_to receive ( :size? ) . with ( cached_s )
82
- expect ( FileUtils ) . to receive ( :mv ) . with ( anything , tmp_file )
83
- expect ( tmp_file ) . to receive ( :rename ) . with ( cached )
82
+ expect ( FileUtils ) . not_to receive ( :mv )
83
+ expect ( FileUtils ) . to receive ( :touch ) . with ( cached )
84
84
85
- expect ( cache . fetch ( original ) { optimized } ) . to eq ( cached )
85
+ expect ( cache . fetch ( original ) { nil } ) . to eq ( nil )
86
86
end
87
87
end
88
88
end
106
106
expect ( FileUtils ) . not_to receive ( :mv )
107
107
expect ( File ) . not_to receive ( :rename )
108
108
109
- expect ( cache . fetch ( original ) { } ) . to eq ( nil )
109
+ expect ( cache . fetch ( original ) { nil } ) . to eq ( nil )
110
110
end
111
111
end
112
112
end
You can’t perform that action at this time.
0 commit comments