tear down the aliases

This commit is contained in:
Les Fletcher 2018-03-08 21:41:11 -08:00 committed by Shishir Kakaraddi
parent c75d7ceadc
commit 3a66a6f80b
2 changed files with 14 additions and 2 deletions

View File

@ -6,4 +6,3 @@ rvm:
- 2.5.0
script:
- bundle exec rspec
- bundle exec rspec spec/lib/instrumentation/as_notifications.rb

View File

@ -1,11 +1,24 @@
require 'spec_helper'
require 'fast_jsonapi/instrumentation'
describe FastJsonapi::ObjectSerializer do
include_context 'movie class'
context 'instrument' do
before(:all) do
require 'fast_jsonapi/instrumentation'
end
after(:all) do
[ :serialized_json, :serializable_hash ].each do |m|
alias_command = "alias_method :#{m}, :#{m}_without_instrumentation"
FastJsonapi::ObjectSerializer.class_eval(alias_command)
remove_command = "remove_method :#{m}_without_instrumentation"
FastJsonapi::ObjectSerializer.class_eval(remove_command)
end
end
before(:each) do
options = {}
options[:meta] = { total: 2 }