@@ -35,12 +35,12 @@ def test_reflection_block_with_link_mutates_the_reflection_links
3535
3636 # Get Reflection
3737 reflection = serializer_class . _reflections . fetch ( :blog )
38- assert_equal @empty_links , reflection . instance_variable_get ( :@_links )
38+ assert_equal @empty_links , reflection . options . fetch ( :links )
3939
4040 # Build Association
4141 association = reflection . build_association ( serializer_instance , @instance_options )
4242 assert_equal @expected_links , association . links
43- assert_equal @expected_links , reflection . instance_variable_get ( :@_links )
43+ assert_equal @expected_links , reflection . options . fetch ( :links )
4444 end
4545
4646 def test_reflection_block_with_link_block_mutates_the_reflection_links
@@ -55,7 +55,7 @@ def test_reflection_block_with_link_block_mutates_the_reflection_links
5555
5656 # Get Reflection
5757 reflection = serializer_class . _reflections . fetch ( :blog )
58- assert_equal @empty_links , reflection . instance_variable_get ( :@_links )
58+ assert_equal @empty_links , reflection . options . fetch ( :links )
5959
6060 # Build Association
6161 association = reflection . build_association ( serializer_instance , @instance_options )
@@ -65,7 +65,7 @@ def test_reflection_block_with_link_block_mutates_the_reflection_links
6565
6666 # Assert after instance_eval link
6767 assert_equal @expected_links . fetch ( :self ) , reflection . instance_eval ( &link )
68- assert_respond_to reflection . instance_variable_get ( :@_links ) . fetch ( :self ) , :call
68+ assert_respond_to reflection . options . fetch ( :links ) . fetch ( :self ) , :call
6969 end
7070
7171 def test_reflection_block_with_meta_mutates_the_reflection_meta
@@ -78,12 +78,12 @@ def test_reflection_block_with_meta_mutates_the_reflection_meta
7878
7979 # Get Reflection
8080 reflection = serializer_class . _reflections . fetch ( :blog )
81- assert_nil reflection . instance_variable_get ( :@_meta )
81+ assert_nil reflection . options . fetch ( :meta )
8282
8383 # Build Association
8484 association = reflection . build_association ( serializer_instance , @instance_options )
8585 assert_equal @expected_meta , association . meta
86- assert_equal @expected_meta , reflection . instance_variable_get ( :@_meta )
86+ assert_equal @expected_meta , reflection . options . fetch ( :meta )
8787 end
8888
8989 def test_reflection_block_with_meta_block_mutates_the_reflection_meta
@@ -98,17 +98,17 @@ def test_reflection_block_with_meta_block_mutates_the_reflection_meta
9898
9999 # Get Reflection
100100 reflection = serializer_class . _reflections . fetch ( :blog )
101- assert_nil reflection . instance_variable_get ( :@_meta )
101+ assert_nil reflection . options . fetch ( :meta )
102102
103103 # Build Association
104104 association = reflection . build_association ( serializer_instance , @instance_options )
105105 # Assert before instance_eval meta
106106 assert_respond_to association . meta , :call
107- assert_respond_to reflection . instance_variable_get ( :@_meta ) , :call
107+ assert_respond_to reflection . options . fetch ( :meta ) , :call
108108
109109 # Assert after instance_eval meta
110110 assert_equal @expected_meta , reflection . instance_eval ( &association . meta )
111- assert_respond_to reflection . instance_variable_get ( :@_meta ) , :call
111+ assert_respond_to reflection . options . fetch ( :meta ) , :call
112112 assert_respond_to association . meta , :call
113113 end
114114
@@ -125,23 +125,23 @@ def test_reflection_block_with_meta_in_link_block_mutates_the_reflection_meta
125125
126126 # Get Reflection
127127 reflection = serializer_class . _reflections . fetch ( :blog )
128- assert_nil reflection . instance_variable_get ( :@_meta )
129- assert_equal @empty_links , reflection . instance_variable_get ( :@_links )
128+ assert_nil reflection . options . fetch ( :meta )
129+ assert_equal @empty_links , reflection . options . fetch ( :links )
130130
131131 # Build Association
132132 association = reflection . build_association ( serializer_instance , @instance_options )
133133 # Assert before instance_eval link meta
134134 assert_nil association . meta
135- assert_nil reflection . instance_variable_get ( :@_meta )
135+ assert_nil reflection . options . fetch ( :meta )
136136
137137 link = association . links . fetch ( :self )
138138 assert_respond_to link , :call
139- assert_respond_to reflection . instance_variable_get ( :@_links ) . fetch ( :self ) , :call
140- assert_nil reflection . instance_variable_get ( :@_meta )
139+ assert_respond_to reflection . options . fetch ( :links ) . fetch ( :self ) , :call
140+ assert_nil reflection . options . fetch ( :meta )
141141
142142 # Assert after instance_eval link
143143 assert_equal 'no_uri_validation' , reflection . instance_eval ( &link )
144- assert_equal @expected_meta , reflection . instance_variable_get ( :@_meta )
144+ assert_equal @expected_meta , reflection . options . fetch ( :meta )
145145 assert_nil association . meta
146146 end
147147
@@ -161,28 +161,28 @@ def test_reflection_block_with_meta_block_in_link_block_mutates_the_reflection_m
161161
162162 # Get Reflection
163163 reflection = serializer_class . _reflections . fetch ( :blog )
164- assert_nil reflection . instance_variable_get ( :@_meta )
164+ assert_nil reflection . options . fetch ( :meta )
165165
166166 # Build Association
167167 association = reflection . build_association ( serializer_instance , @instance_options )
168168 assert_nil association . meta
169- assert_nil reflection . instance_variable_get ( :@_meta )
169+ assert_nil reflection . options . fetch ( :meta )
170170
171171 # Assert before instance_eval link
172172 link = association . links . fetch ( :self )
173- assert_nil reflection . instance_variable_get ( :@_meta )
173+ assert_nil reflection . options . fetch ( :meta )
174174 assert_respond_to link , :call
175175 assert_respond_to association . links . fetch ( :self ) , :call
176176
177177 # Assert after instance_eval link
178178 assert_equal 'no_uri_validation' , reflection . instance_eval ( &link )
179179 assert_respond_to association . links . fetch ( :self ) , :call
180180 # Assert before instance_eval link meta
181- assert_respond_to reflection . instance_variable_get ( :@_meta ) , :call
181+ assert_respond_to reflection . options . fetch ( :meta ) , :call
182182 assert_nil association . meta
183183
184184 # Assert after instance_eval link meta
185- assert_equal @expected_meta , reflection . instance_eval ( &reflection . instance_variable_get ( :@_meta ) )
185+ assert_equal @expected_meta , reflection . instance_eval ( &reflection . options . fetch ( :meta ) )
186186 assert_nil association . meta
187187 end
188188 # rubocop:enable Metrics/AbcSize
@@ -199,7 +199,7 @@ def test_no_href_in_vanilla_reflection
199199
200200 # Get Reflection
201201 reflection = serializer_class . _reflections . fetch ( :blog )
202- assert_equal @empty_links , reflection . instance_variable_get ( :@_links )
202+ assert_equal @empty_links , reflection . options . fetch ( :links )
203203
204204 # Build Association
205205 association = reflection . build_association ( serializer_instance , @instance_options )
0 commit comments