I'm not sure you need that .with(:file)
part, try dropping it altogether. Also, I believe by specifying it that way you are literally telling it to expect someone to call that method and pass it a :file
symbol rather than e.g. a string filename. Also consider preloading the test YAML file and just returning that:
let(:file_like_object) { double("file like object") }
File.stub(:open).and_return(file_like_object)