Autowrite is a feature built into Vim. Check out :help 'autowrite'
for Vim’s docs on it.
One of the reasons I like dispatch.vim and vim-rspec is that they work well together with autowrite.
I try to avoid thinking in low level actions like “save the current file, run this spec.” Instead, I use autowrite and vim-rspec to do things like “run whatever spec I’m working on and write the necessary files to run it.”