spec/rtsp/message_spec.rb in rtsp-0.4.0 vs spec/rtsp/message_spec.rb in rtsp-0.4.1
- old
+ new
@@ -104,13 +104,13 @@
message.to_s.should include "Content-Type: application/sdp, application/rtsl\r\n"
message.to_s.should match(/\r\n\r\n$/)
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,
content_type: 'application/sdp',
cseq: 2345 })
@@ -119,11 +119,11 @@
message.to_s.should match(/^ANNOUNCE rtsp/)
message.to_s.should include "ANNOUNCE rtsp://1.2.3.4:554/stream1 RTSP/1.0\r\n"
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
context "builds a SETUP string" do
it "with default sequence, client_port, and routing values" do