Skip to content

Commit 077817e

Browse files
hmcfletchshishirmk
authored andcommitted
fix skylight normalizers issue
1 parent ac136b9 commit 077817e

4 files changed

Lines changed: 25 additions & 4 deletions

File tree

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
require 'skylight'
2+
3+
SKYLIGHT_NORMALIZER_BASE_CLASS = begin
4+
::Skylight::Core::Normalizers::Normalizer
5+
rescue NameError
6+
::Skylight::Normalizers::Normalizer
7+
end

lib/fast_jsonapi/instrumentation/skylight/normalizers/serializable_hash.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
require 'skylight'
1+
require 'fast_jsonapi/instrumentation/skylight/normalizers/base'
22
require 'fast_jsonapi/instrumentation/serializable_hash'
33

44
module FastJsonapi
55
module Instrumentation
66
module Skylight
77
module Normalizers
8-
class SerializableHash < Skylight::Normalizers::Normalizer
8+
class SerializableHash < SKYLIGHT_NORMALIZER_BASE_CLASS
99

1010
register FastJsonapi::ObjectSerializer::SERIALIZABLE_HASH_NOTIFICATION
1111

lib/fast_jsonapi/instrumentation/skylight/normalizers/serialized_json.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
require 'skylight'
1+
require 'fast_jsonapi/instrumentation/skylight/normalizers/base'
22
require 'fast_jsonapi/instrumentation/serializable_hash'
33

44
module FastJsonapi
55
module Instrumentation
66
module Skylight
77
module Normalizers
8-
class SerializedJson < Skylight::Normalizers::Normalizer
8+
class SerializedJson < SKYLIGHT_NORMALIZER_BASE_CLASS
99

1010
register FastJsonapi::ObjectSerializer::SERIALIZED_JSON_NOTIFICATION
1111

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
require 'spec_helper'
2+
3+
describe FastJsonapi::ObjectSerializer do
4+
5+
context 'instrument' do
6+
context 'skylight' do
7+
# skip for normal runs because this could alter some
8+
# other test by insterting the instrumentation
9+
xit 'make sure requiring skylight normalizers works' do
10+
require 'fast_jsonapi/instrumentation/skylight'
11+
end
12+
end
13+
end
14+
end

0 commit comments

Comments
 (0)