tear down the aliases
This commit is contained in:
parent
c75d7ceadc
commit
3a66a6f80b
@ -6,4 +6,3 @@ rvm:
|
|||||||
- 2.5.0
|
- 2.5.0
|
||||||
script:
|
script:
|
||||||
- bundle exec rspec
|
- bundle exec rspec
|
||||||
- bundle exec rspec spec/lib/instrumentation/as_notifications.rb
|
|
||||||
|
@ -1,11 +1,24 @@
|
|||||||
require 'spec_helper'
|
require 'spec_helper'
|
||||||
require 'fast_jsonapi/instrumentation'
|
|
||||||
|
|
||||||
describe FastJsonapi::ObjectSerializer do
|
describe FastJsonapi::ObjectSerializer do
|
||||||
include_context 'movie class'
|
include_context 'movie class'
|
||||||
|
|
||||||
context 'instrument' do
|
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
|
before(:each) do
|
||||||
options = {}
|
options = {}
|
||||||
options[:meta] = { total: 2 }
|
options[:meta] = { total: 2 }
|
Loading…
x
Reference in New Issue
Block a user