Added tests for detect and propagate file changes on rebuild

Adds tests for #2465
This should be initialiZed in init