Fix environment.rb errors in spec, replace stub with new rspec syntax