Skip to content

Instantly share code, notes, and snippets.

@kstevens715
Created April 3, 2018 20:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kstevens715/d5acb7c1b3950d4460012639a4701ba2 to your computer and use it in GitHub Desktop.
Save kstevens715/d5acb7c1b3950d4460012639a4701ba2 to your computer and use it in GitHub Desktop.
require "test_helper"
require "support/matchers/scopes"
require "support/double_helpers"
describe Applicant do
it do
deprecation_warnings_for_file('app/models/applicant.rb').length.must_equal 0
end
private
def deprecation_warnings_for_file(path)
original_behavior = ActiveSupport::Deprecation.behavior
messages = []
ActiveSupport::Deprecation.behavior = ->(message, callstack) {
messages << message
}
load(path)
messages
ensure
ActiveSupport::Deprecation.behavior = original_behavior
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment