Skip to content

Instantly share code, notes, and snippets.

@thbar
Last active December 31, 2015 03:29
Show Gist options
  • Save thbar/7927843 to your computer and use it in GitHub Desktop.
Save thbar/7927843 to your computer and use it in GitHub Desktop.
Get an error to make sure you review Rails changes.

When applying Rails upgrades on WiseCash, I want to make sure I review the commits to spot potential regressions. This RSpec spec warns me when I'm upgrading at any time (even tired, where you might forgot to do so).

require 'spec_helper'
describe 'Upgrading' do
let(:verified_version) { '3.2.15' }
let(:current_version) { Rails::VERSION::STRING }
it 'warns us when upgrading Rails' do
if current_version != verified_version
url = "https://github.com/rails/rails/compare/v#{verified_version}...v#{current_version}"
fail "Upgrading Rails! Please review the changes first - #{url}"
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment