File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ class PingFrame < Frame
15
15
# Generate a suitable reply.
16
16
# @returns [PongFrame]
17
17
def reply ( **options )
18
- PongFrame . new ( true , self . unpack , **options )
18
+ PongFrame . new ( true , **options ) . pack ( self . unpack )
19
19
end
20
20
21
21
# Apply this frame to the specified connection.
Original file line number Diff line number Diff line change 15
15
it "is a control frame" do
16
16
expect ( frame ) . to be ( :control? )
17
17
end
18
+
19
+ with "#reply" do
20
+ it "can generate an appropriately masked reply" do
21
+ frame . pack ( "Hello, World!" )
22
+
23
+ reply = frame . reply ( mask : "mask" )
24
+
25
+ expect ( reply . mask ) . to be == "mask"
26
+ expect ( reply . payload ) . not . to be == "Hello, World!"
27
+ expect ( reply . unpack ) . to be == "Hello, World!"
28
+ end
29
+ end
18
30
end
You can’t perform that action at this time.
0 commit comments