improve calculating rvmrc warning target file, update #2328
add tests for #2328