@@ -180,17 +180,27 @@ def test_deconstruct_keys
180180 d = Date . new ( 1999 , 5 , 23 )
181181 assert_equal ( { year : 1999 , month : 5 , day : 23 , wday : 0 , yday : 143 } , d . deconstruct_keys ( nil ) )
182182 assert_equal ( { year : 1999 } , d . deconstruct_keys ( [ :year , :century ] ) )
183+ assert_equal (
184+ { year : 1999 , month : 5 , day : 23 , wday : 0 , yday : 143 } ,
185+ d . deconstruct_keys ( [ :year , :month , :day , :wday , :yday ] )
186+ )
183187
184188 dt = DateTime . new ( 1999 , 5 , 23 , 4 , 20 , Rational ( 1 , 10000 ) )
185189
186190 assert_equal (
187191 { year : 1999 , month : 5 , day : 23 , wday : 0 , yday : 143 ,
188- hour : 4 , min : 20 , sec : 13 , sec : 0 , sec_fraction : Rational ( 1 , 10000 ) , zone : "+00:00" } ,
192+ hour : 4 , min : 20 , sec : 0 , sec_fraction : Rational ( 1 , 10000 ) , zone : "+00:00" } ,
189193 dt . deconstruct_keys ( nil )
190194 )
191195
192196 assert_equal ( { year : 1999 } , dt . deconstruct_keys ( [ :year , :century ] ) )
193197
198+ assert_equal (
199+ { year : 1999 , month : 5 , day : 23 , wday : 0 , yday : 143 ,
200+ hour : 4 , min : 20 , sec : 0 , sec_fraction : Rational ( 1 , 10000 ) , zone : "+00:00" } ,
201+ dt . deconstruct_keys ( [ :year , :month , :day , :wday , :yday , :hour , :min , :sec , :sec_fraction , :zone ] )
202+ )
203+
194204 dtz = DateTime . parse ( '3rd Feb 2001 04:05:06+03:30' )
195205 assert_equal ( { zone : '+03:30' } , dtz . deconstruct_keys ( [ :zone ] ) )
196206 end
0 commit comments