Mg rspec warning

Closes #341 and add the `infer_spec_type_from_file_location`