Skip to content
This repository has been archived by the owner on May 17, 2023. It is now read-only.

Commit

Permalink
Stub SDP::Description
Browse files Browse the repository at this point in the history
This gets around the bug found with calling #to_s on an
SDP::Description object--its size is different when JRuby vs. MRI.
  • Loading branch information
turboladen committed Nov 3, 2012
1 parent 7e37381 commit 627fa3a
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions spec/rtsp/message_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,9 @@
end

it "with passed-in sequence, session, content-type, and SDP body" do
sdp = SDP::Description.new
sdp.protocol_version = 1
sdp.username = 'bobo'
sdp_string = "this is a fake description"
sdp = double "SDP::Description"
sdp.stub(:to_s).and_return sdp_string

message = RTSP::Message.announce(stream).with_headers({
session: 123456789,
Expand All @@ -121,8 +121,8 @@
message.to_s.should include "CSeq: 2345\r\n"
message.to_s.should include "Session: 123456789\r\n"
message.to_s.should include "Content-Type: application/sdp\r\n"
message.to_s.should include "Content-Length: 29\r\n"
message.to_s.should match(/\r\n\r\nv=1\r\no=bobo \r\ns=\r\nt= \r\n\r\n$/)
message.to_s.should include "Content-Length: #{sdp_string.length}\r\n"
message.to_s.should match(/\r\n\r\n#{sdp_string}$/)
end
end

Expand Down

0 comments on commit 627fa3a

Please sign in to comment.