Skip to content

Commit 3a66a6f

Browse files
hmcfletchshishirmk
authored andcommitted
tear down the aliases
1 parent c75d7ce commit 3a66a6f

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

.travis.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,3 @@ rvm:
66
- 2.5.0
77
script:
88
- bundle exec rspec
9-
- bundle exec rspec spec/lib/instrumentation/as_notifications.rb

spec/lib/instrumentation/as_notifications.rb renamed to spec/lib/instrumentation/as_notifications_spec.rb

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,24 @@
11
require 'spec_helper'
2-
require 'fast_jsonapi/instrumentation'
32

43
describe FastJsonapi::ObjectSerializer do
54
include_context 'movie class'
65

76
context 'instrument' do
87

8+
before(:all) do
9+
require 'fast_jsonapi/instrumentation'
10+
end
11+
12+
after(:all) do
13+
[ :serialized_json, :serializable_hash ].each do |m|
14+
alias_command = "alias_method :#{m}, :#{m}_without_instrumentation"
15+
FastJsonapi::ObjectSerializer.class_eval(alias_command)
16+
17+
remove_command = "remove_method :#{m}_without_instrumentation"
18+
FastJsonapi::ObjectSerializer.class_eval(remove_command)
19+
end
20+
end
21+
922
before(:each) do
1023
options = {}
1124
options[:meta] = { total: 2 }

0 commit comments

Comments
 (0)