@@ -106,7 +106,7 @@ class IKE
106106 expect ( trans . type ) . to eq ( 1 )
107107 expect ( trans . rsv2 ) . to eq ( 0 )
108108 expect ( trans . id ) . to eq ( 0 )
109- expect ( trans . attributes ) . to be_empty
109+ expect ( trans . tattributes ) . to be_empty
110110 end
111111
112112 it 'accepts options' do
@@ -150,8 +150,8 @@ class IKE
150150 expect ( @trans . rsv2 ) . to eq ( 0 )
151151 expect ( @trans . id ) . to eq ( 20 )
152152 expect ( @trans . human_id ) . to eq ( 'AES_GCM16' )
153- expect ( @trans . attributes . size ) . to eq ( 1 )
154- expect ( @trans . attributes . first . to_human ) . to eq ( 'KEY_LENGTH=256' )
153+ expect ( @trans . tattributes . size ) . to eq ( 1 )
154+ expect ( @trans . tattributes . first . to_human ) . to eq ( 'KEY_LENGTH=256' )
155155 end
156156 end
157157
@@ -167,27 +167,27 @@ class IKE
167167 end
168168
169169 it 'returns a human readable string with undefined type and ID' do
170- @trans [ :type ] . read 50
170+ @trans [ :type ] . value = 50
171171 @trans . id = 60
172- @trans . attributes . clear
172+ @trans . tattributes . clear
173173 expect ( @trans . to_human ) . to eq ( 'type[50](ID=60)' )
174174 end
175175
176- describe '#attributes ' do
176+ describe '#tattributes ' do
177177 let ( :trans ) { Transform . new }
178178
179179 it 'accepts an Attribute' do
180180 attr = Attribute . new ( type : 0x800e , value : 128 )
181- expect { trans . attributes << attr } . to change ( trans . attributes , :size ) . by ( 1 )
181+ expect { trans . tattributes << attr } . to change ( trans . tattributes , :size ) . by ( 1 )
182182 attr = Attribute . new ( type : 12 , value : 7 )
183- expect { trans . attributes << attr } . to change ( trans . attributes , :size ) . by ( 1 )
183+ expect { trans . tattributes << attr } . to change ( trans . tattributes , :size ) . by ( 1 )
184184 expect ( trans . to_human ) . to eq ( 'ENCR(ID=0,KEY_LENGTH=128,attr[12]=7)' )
185185 end
186186
187187 it 'accepts a Hash describing an attribute' do
188- expect { trans . attributes << { type : 0x800e , value : 192 } } .
189- to change ( trans . attributes , :size ) . by ( 1 )
190- expect ( trans . attributes . first ) . to be_a ( Attribute )
188+ expect { trans . tattributes << { type : 0x800e , value : 192 } } .
189+ to change ( trans . tattributes , :size ) . by ( 1 )
190+ expect ( trans . tattributes . first ) . to be_a ( Attribute )
191191 expect ( trans . to_human ) . to eq ( 'ENCR(ID=0,KEY_LENGTH=192)' )
192192 end
193193 end
@@ -253,7 +253,7 @@ class IKE
253253 expect ( @prop . human_protocol ) . to eq ( 'ESP' )
254254 expect ( @prop . spi_size ) . to eq ( 4 )
255255 expect ( @prop . num_trans ) . to eq ( 2 )
256- expect ( PacketGen :: Types ::Int32 . new . read ( @prop . spi ) . to_i ) . to eq ( 0x12345678 )
256+ expect ( BinStruct ::Int32 . new . read ( @prop . spi ) . to_i ) . to eq ( 0x12345678 )
257257 expect ( @prop . transforms . size ) . to eq ( 2 )
258258 expect ( @prop . transforms . to_human ) . to eq ( 'ENCR(DES_IV64),INTG(AES192_GMAC)' )
259259 end
@@ -355,7 +355,7 @@ class IKE
355355 it 'returns a string with all attributes' do
356356 str = @sa . inspect
357357 expect ( str ) . to be_a ( String )
358- ( @sa . fields - %i( body ) ) . each do |attr |
358+ ( @sa . attributes - %i( body ) ) . each do |attr |
359359 expect ( str ) . to include ( attr . to_s )
360360 end
361361 end
@@ -392,7 +392,7 @@ class IKE
392392 it 'sets length fields recursively' do
393393 @sa . proposals << { num : 2 , protocol : 'IKE' , last : 43 }
394394 @sa . proposals . last . transforms << { type : 'ENCR' , id : 'AES_CTR' }
395- @sa . proposals . last . transforms . last . attributes << { type : 0x800e , value : 128 }
395+ @sa . proposals . last . transforms . last . tattributes << { type : 0x800e , value : 128 }
396396 expect ( @sa . proposals . last . length ) . to eq ( 8 )
397397 expect ( @sa . proposals . last . transforms . last . length ) . to eq ( 8 )
398398 @sa . calc_length
0 commit comments