sdp 0.2.8 → 0.2.9
Sign up to get free protection for your applications and to get access to all the features.
- data/ChangeLog.rdoc +13 -0
- data/LICENSE.rdoc +1 -1
- data/README.rdoc +31 -11
- data/Rakefile +3 -10
- data/lib/sdp/description.rb +132 -16
- data/lib/sdp/parser.rb +4 -4
- data/lib/sdp/version.rb +1 -1
- data/sdp.gemspec +15 -15
- data/spec/integration/builds_descriptions_spec.rb +39 -0
- data/spec/integration/coverage/assets/0.7.1/application.css +1110 -0
- data/spec/integration/coverage/assets/0.7.1/application.js +626 -0
- data/spec/integration/coverage/assets/0.7.1/fancybox/blank.gif +0 -0
- data/spec/integration/coverage/assets/0.7.1/fancybox/fancy_close.png +0 -0
- data/spec/integration/coverage/assets/0.7.1/fancybox/fancy_loading.png +0 -0
- data/spec/integration/coverage/assets/0.7.1/fancybox/fancy_nav_left.png +0 -0
- data/spec/integration/coverage/assets/0.7.1/fancybox/fancy_nav_right.png +0 -0
- data/spec/integration/coverage/assets/0.7.1/fancybox/fancy_shadow_e.png +0 -0
- data/spec/integration/coverage/assets/0.7.1/fancybox/fancy_shadow_n.png +0 -0
- data/spec/integration/coverage/assets/0.7.1/fancybox/fancy_shadow_ne.png +0 -0
- data/spec/integration/coverage/assets/0.7.1/fancybox/fancy_shadow_nw.png +0 -0
- data/spec/integration/coverage/assets/0.7.1/fancybox/fancy_shadow_s.png +0 -0
- data/spec/integration/coverage/assets/0.7.1/fancybox/fancy_shadow_se.png +0 -0
- data/spec/integration/coverage/assets/0.7.1/fancybox/fancy_shadow_sw.png +0 -0
- data/spec/integration/coverage/assets/0.7.1/fancybox/fancy_shadow_w.png +0 -0
- data/spec/integration/coverage/assets/0.7.1/fancybox/fancy_title_left.png +0 -0
- data/spec/integration/coverage/assets/0.7.1/fancybox/fancy_title_main.png +0 -0
- data/spec/integration/coverage/assets/0.7.1/fancybox/fancy_title_over.png +0 -0
- data/spec/integration/coverage/assets/0.7.1/fancybox/fancy_title_right.png +0 -0
- data/spec/integration/coverage/assets/0.7.1/fancybox/fancybox-x.png +0 -0
- data/spec/integration/coverage/assets/0.7.1/fancybox/fancybox-y.png +0 -0
- data/spec/integration/coverage/assets/0.7.1/fancybox/fancybox.png +0 -0
- data/spec/integration/coverage/assets/0.7.1/favicon_green.png +0 -0
- data/spec/integration/coverage/assets/0.7.1/favicon_red.png +0 -0
- data/spec/integration/coverage/assets/0.7.1/favicon_yellow.png +0 -0
- data/spec/integration/coverage/assets/0.7.1/loading.gif +0 -0
- data/spec/integration/coverage/assets/0.7.1/magnify.png +0 -0
- data/spec/integration/coverage/assets/0.7.1/smoothness/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
- data/spec/integration/coverage/assets/0.7.1/smoothness/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
- data/spec/integration/coverage/assets/0.7.1/smoothness/images/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
- data/spec/integration/coverage/assets/0.7.1/smoothness/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
- data/spec/integration/coverage/assets/0.7.1/smoothness/images/ui-bg_glass_75_dadada_1x400.png +0 -0
- data/spec/integration/coverage/assets/0.7.1/smoothness/images/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
- data/spec/integration/coverage/assets/0.7.1/smoothness/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
- data/spec/integration/coverage/assets/0.7.1/smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
- data/spec/integration/coverage/assets/0.7.1/smoothness/images/ui-icons_222222_256x240.png +0 -0
- data/spec/integration/coverage/assets/0.7.1/smoothness/images/ui-icons_2e83ff_256x240.png +0 -0
- data/spec/integration/coverage/assets/0.7.1/smoothness/images/ui-icons_454545_256x240.png +0 -0
- data/spec/integration/coverage/assets/0.7.1/smoothness/images/ui-icons_888888_256x240.png +0 -0
- data/spec/integration/coverage/assets/0.7.1/smoothness/images/ui-icons_cd0a0a_256x240.png +0 -0
- data/spec/integration/coverage/index.html +72 -0
- data/spec/integration/parses_descriptions_spec.rb +129 -0
- data/spec/spec_helper.rb +2 -1
- data/spec/support/parser_matcher.rb +33 -0
- data/{features → spec}/support/sdp_file.txt +0 -0
- data/spec/support/test_descriptions.rb +137 -0
- data/spec/unit/sdp/coverage/assets/0.7.1/application.css +1110 -0
- data/spec/unit/sdp/coverage/assets/0.7.1/application.js +626 -0
- data/spec/unit/sdp/coverage/assets/0.7.1/fancybox/blank.gif +0 -0
- data/spec/unit/sdp/coverage/assets/0.7.1/fancybox/fancy_close.png +0 -0
- data/spec/unit/sdp/coverage/assets/0.7.1/fancybox/fancy_loading.png +0 -0
- data/spec/unit/sdp/coverage/assets/0.7.1/fancybox/fancy_nav_left.png +0 -0
- data/spec/unit/sdp/coverage/assets/0.7.1/fancybox/fancy_nav_right.png +0 -0
- data/spec/unit/sdp/coverage/assets/0.7.1/fancybox/fancy_shadow_e.png +0 -0
- data/spec/unit/sdp/coverage/assets/0.7.1/fancybox/fancy_shadow_n.png +0 -0
- data/spec/unit/sdp/coverage/assets/0.7.1/fancybox/fancy_shadow_ne.png +0 -0
- data/spec/unit/sdp/coverage/assets/0.7.1/fancybox/fancy_shadow_nw.png +0 -0
- data/spec/unit/sdp/coverage/assets/0.7.1/fancybox/fancy_shadow_s.png +0 -0
- data/spec/unit/sdp/coverage/assets/0.7.1/fancybox/fancy_shadow_se.png +0 -0
- data/spec/unit/sdp/coverage/assets/0.7.1/fancybox/fancy_shadow_sw.png +0 -0
- data/spec/unit/sdp/coverage/assets/0.7.1/fancybox/fancy_shadow_w.png +0 -0
- data/spec/unit/sdp/coverage/assets/0.7.1/fancybox/fancy_title_left.png +0 -0
- data/spec/unit/sdp/coverage/assets/0.7.1/fancybox/fancy_title_main.png +0 -0
- data/spec/unit/sdp/coverage/assets/0.7.1/fancybox/fancy_title_over.png +0 -0
- data/spec/unit/sdp/coverage/assets/0.7.1/fancybox/fancy_title_right.png +0 -0
- data/spec/unit/sdp/coverage/assets/0.7.1/fancybox/fancybox-x.png +0 -0
- data/spec/unit/sdp/coverage/assets/0.7.1/fancybox/fancybox-y.png +0 -0
- data/spec/unit/sdp/coverage/assets/0.7.1/fancybox/fancybox.png +0 -0
- data/spec/unit/sdp/coverage/assets/0.7.1/favicon_green.png +0 -0
- data/spec/unit/sdp/coverage/assets/0.7.1/favicon_red.png +0 -0
- data/spec/unit/sdp/coverage/assets/0.7.1/favicon_yellow.png +0 -0
- data/spec/unit/sdp/coverage/assets/0.7.1/loading.gif +0 -0
- data/spec/unit/sdp/coverage/assets/0.7.1/magnify.png +0 -0
- data/spec/unit/sdp/coverage/assets/0.7.1/smoothness/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
- data/spec/unit/sdp/coverage/assets/0.7.1/smoothness/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
- data/spec/unit/sdp/coverage/assets/0.7.1/smoothness/images/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
- data/spec/unit/sdp/coverage/assets/0.7.1/smoothness/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
- data/spec/unit/sdp/coverage/assets/0.7.1/smoothness/images/ui-bg_glass_75_dadada_1x400.png +0 -0
- data/spec/unit/sdp/coverage/assets/0.7.1/smoothness/images/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
- data/spec/unit/sdp/coverage/assets/0.7.1/smoothness/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
- data/spec/unit/sdp/coverage/assets/0.7.1/smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
- data/spec/unit/sdp/coverage/assets/0.7.1/smoothness/images/ui-icons_222222_256x240.png +0 -0
- data/spec/unit/sdp/coverage/assets/0.7.1/smoothness/images/ui-icons_2e83ff_256x240.png +0 -0
- data/spec/unit/sdp/coverage/assets/0.7.1/smoothness/images/ui-icons_454545_256x240.png +0 -0
- data/spec/unit/sdp/coverage/assets/0.7.1/smoothness/images/ui-icons_888888_256x240.png +0 -0
- data/spec/unit/sdp/coverage/assets/0.7.1/smoothness/images/ui-icons_cd0a0a_256x240.png +0 -0
- data/spec/unit/sdp/coverage/index.html +72 -0
- data/spec/unit/sdp/description_spec.rb +321 -0
- data/spec/unit/sdp/parser_spec.rb +154 -0
- data/spec/{sdp_spec.rb → unit/sdp_spec.rb} +2 -2
- metadata +189 -43
- data/features/accepts_description_text.feature +0 -12
- data/features/sdp_create.feature +0 -15
- data/features/sdp_get.feature +0 -37
- data/features/step_definitions/accepts_description_text_steps.rb +0 -15
- data/features/step_definitions/sdp_create_steps.rb +0 -48
- data/features/step_definitions/sdp_get_steps.rb +0 -23
- data/features/support/env.rb +0 -3
- data/lib/sdp/session_template.erb +0 -46
- data/spec/sdp/description_spec.rb +0 -392
- data/spec/sdp/parser_spec.rb +0 -207
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
@@ -0,0 +1,72 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html xmlns='http://www.w3.org/1999/xhtml'>
|
3
|
+
<head>
|
4
|
+
<title>Code coverage for Integration</title>
|
5
|
+
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
|
6
|
+
<script src='./assets/0.7.1/application.js' type='text/javascript'></script>
|
7
|
+
<link href='./assets/0.7.1/application.css' media='screen, projection, print' rel='stylesheet' type='text/css'>
|
8
|
+
<link rel="shortcut icon" type="image/png" href="./assets/0.7.1/favicon_green.png" />
|
9
|
+
<link rel="icon" type="image/png" href="./assets/0.7.1/favicon.png" />
|
10
|
+
</head>
|
11
|
+
|
12
|
+
<body>
|
13
|
+
<div id="loading">
|
14
|
+
<img src="./assets/0.7.1/loading.gif" alt="loading"/>
|
15
|
+
</div>
|
16
|
+
<div id="wrapper" style="display:none;">
|
17
|
+
<div class="timestamp">Generated <abbr class="timeago" title="2012-11-19T18:10:30-08:00">2012-11-19T18:10:30-08:00</abbr></div>
|
18
|
+
<ul class="group_tabs"></ul>
|
19
|
+
|
20
|
+
<div id="content">
|
21
|
+
<div class="file_list_container" id="AllFiles">
|
22
|
+
<h2>
|
23
|
+
<span class="group_name">All Files</span>
|
24
|
+
(<span class="covered_percent"><span class="green">100.0%</span></span>
|
25
|
+
covered at
|
26
|
+
<span class="covered_strength">
|
27
|
+
<span class="red">
|
28
|
+
0.0
|
29
|
+
</span>
|
30
|
+
</span> hits/line)
|
31
|
+
</h2>
|
32
|
+
<a name="AllFiles"></a>
|
33
|
+
<div>
|
34
|
+
<b>0</b> files in total.
|
35
|
+
<b>0.0</b> relevant lines.
|
36
|
+
<span class="green"><b>0.0</b> lines covered</span> and
|
37
|
+
<span class="red"><b>0.0</b> lines missed </span>
|
38
|
+
</div>
|
39
|
+
<table class="file_list">
|
40
|
+
<thead>
|
41
|
+
<tr>
|
42
|
+
<th>File</th>
|
43
|
+
<th>% covered</th>
|
44
|
+
<th>Lines</th>
|
45
|
+
<th>Relevant Lines</th>
|
46
|
+
<th>Lines covered</th>
|
47
|
+
<th>Lines missed</th>
|
48
|
+
<th>Avg. Hits / Line</th>
|
49
|
+
</tr>
|
50
|
+
</thead>
|
51
|
+
<tbody>
|
52
|
+
|
53
|
+
</tbody>
|
54
|
+
</table>
|
55
|
+
</div>
|
56
|
+
|
57
|
+
|
58
|
+
|
59
|
+
</div>
|
60
|
+
|
61
|
+
<div id="footer">
|
62
|
+
Generated by <a href="http://github.com/colszowka/simplecov">simplecov</a> v0.7.1
|
63
|
+
and simplecov-html v0.7.1<br/>
|
64
|
+
using RSpec
|
65
|
+
</div>
|
66
|
+
|
67
|
+
<div class="source_files">
|
68
|
+
|
69
|
+
</div>
|
70
|
+
</div>
|
71
|
+
</body>
|
72
|
+
</html>
|
@@ -0,0 +1,129 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
require 'sdp/parser'
|
3
|
+
require 'base64'
|
4
|
+
|
5
|
+
describe "Parsing and creating descriptions" do
|
6
|
+
subject { SDP::Parser.new }
|
7
|
+
|
8
|
+
context "required fields only" do
|
9
|
+
let(:description) { REQUIRED_ONLY }
|
10
|
+
|
11
|
+
it "successfully parses and is valid" do
|
12
|
+
result = subject.should parse(description)
|
13
|
+
result.should be_a_valid_description
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
context "missing required values" do
|
18
|
+
%w[NO_VERSION NO_ORIGIN NO_NAME NO_CONNECT NO_TIMING].each do |missing_line|
|
19
|
+
context missing_line.downcase.sub!(/_/, " ") do
|
20
|
+
let(:description) { TestDescriptions.const_get(missing_line.to_sym) }
|
21
|
+
|
22
|
+
it "successfully parses but is not valid" do
|
23
|
+
result = subject.should parse(description)
|
24
|
+
result.should_not be_a_valid_description
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
context "more than one time description" do
|
31
|
+
let(:description) { TWO_TIME_DESCRIPTIONS }
|
32
|
+
|
33
|
+
it "successfully parses and is valid" do
|
34
|
+
pending "https://github.com/turboladen/sdp/issues/8"
|
35
|
+
|
36
|
+
result = subject.should parse(description)
|
37
|
+
result.should be_a_valid_description
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
context "one media section" do
|
42
|
+
context "required media lines" do
|
43
|
+
context "no sections contain connect line" do
|
44
|
+
let(:description) { ONE_MEDIA_SECTION_NO_CONNECT }
|
45
|
+
|
46
|
+
it "successfully parses and is not valid" do
|
47
|
+
result = subject.should parse(description)
|
48
|
+
result.should_not be_a_valid_description
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
52
|
+
context "session section contains connect line" do
|
53
|
+
let(:description) { ONE_MEDIA_SECTION_CONNECT_IN_SESSION }
|
54
|
+
|
55
|
+
it "successfully parses and is valid" do
|
56
|
+
result = subject.should parse(description)
|
57
|
+
result.should be_a_valid_description
|
58
|
+
end
|
59
|
+
end
|
60
|
+
|
61
|
+
context "media section contains connect line" do
|
62
|
+
let(:description) { ONE_MEDIA_SECTION_CONNECT_IN_MEDIA }
|
63
|
+
|
64
|
+
it "successfully parses and is valid" do
|
65
|
+
result = subject.should parse(description)
|
66
|
+
result.should be_a_valid_description
|
67
|
+
end
|
68
|
+
end
|
69
|
+
end
|
70
|
+
end
|
71
|
+
|
72
|
+
context "two media sections" do
|
73
|
+
context "required media lines" do
|
74
|
+
context "no sections contain connect line" do
|
75
|
+
let(:description) { TWO_MEDIA_SECTIONS_NO_CONNECT }
|
76
|
+
|
77
|
+
it "successfully parses and is not valid" do
|
78
|
+
result = subject.should parse(description)
|
79
|
+
result.should_not be_a_valid_description
|
80
|
+
end
|
81
|
+
end
|
82
|
+
|
83
|
+
context "session section contains connect line" do
|
84
|
+
let(:description) { TWO_MEDIA_SECTIONS_CONNECT_IN_SESSION }
|
85
|
+
|
86
|
+
it "successfully parses and is valid" do
|
87
|
+
result = subject.should parse(description)
|
88
|
+
result.should be_a_valid_description
|
89
|
+
end
|
90
|
+
end
|
91
|
+
|
92
|
+
context "media sections contain connect line" do
|
93
|
+
let(:description) { TWO_MEDIA_SECTIONS_CONNECT_IN_MEDIA }
|
94
|
+
|
95
|
+
it "successfully parses and is valid" do
|
96
|
+
result = subject.should parse(description)
|
97
|
+
result.should be_a_valid_description
|
98
|
+
end
|
99
|
+
end
|
100
|
+
end
|
101
|
+
end
|
102
|
+
|
103
|
+
context "other combinations" do
|
104
|
+
let(:valid_sdps) do
|
105
|
+
[
|
106
|
+
"v=1\no=steve 1234 5555 IN IP4 123.33.22.123\ns=This is a test session\ni=And here's some info\nu=http://bobo.net/thispdf.pdf\ne=bob@thing.com (Bob!)\np=+1 555 123 0987\nc=IN IP4 224.5.234.22/24\nb=CT:1000\nt=11111 22222\nr=7d 1h 0 25h\nz=2882844526 -1h 2898848070 0\n\k=prompt\na=recvonly\na=bobo:the clown\nm=video 49170/2 RTP/AVP 31\na=hotness\na=attribute2:do stuff\nm=audio 12335 RTP/AVP 99\na=make:it now\n",
|
107
|
+
"v=1\no=steve 1234 5555 IN IP4 123.33.22.123\ns=This is a test session\ni=And here's some info\nu=http://bobo.net/thispdf.pdf\ne=bob@thing.com (Bob!)\np=+1 555 123 0987\nc=IN IP4 224.5.234.22/24\nb=CT:1000\nt=11111 22222\nr=7d 1h 0 25h\nz=2882844526 -1h 2898848070 0\n\k=prompt\na=recvonly\na=bobo:the clown\n",
|
108
|
+
"v=1\no=steve 1234 5555 IN IP4 123.33.22.123\ns=This is a test session\ni=And here's some info\nu=http://bobo.net/thispdf.pdf\ne=bob@thing.com (Bob!)\np=+1 555 123 0987\nc=IN IP4 224.5.234.22/24\nb=CT:1000\nt=11111 22222\nr=7d 1h 0 25h\nz=2882844526 -1h 2898848070 0\n\k=prompt\n",
|
109
|
+
"v=1\no=steve 1234 5555 IN IP4 123.33.22.123\ns=This is a test session\ni=And here's some info\nu=http://bobo.net/thispdf.pdf\ne=bob@thing.com (Bob!)\np=+1 555 123 0987\nc=IN IP4 224.5.234.22/24\nb=CT:1000\nt=11111 22222\nr=7d 1h 0 25h\nz=2882844526 -1h 2898848070 0\n\k=clear:password\n",
|
110
|
+
"v=1\no=steve 1234 5555 IN IP4 123.33.22.123\ns=This is a test session\ni=And here's some info\nu=http://bobo.net/thispdf.pdf\ne=bob@thing.com (Bob!)\np=+1 555 123 0987\nc=IN IP4 224.5.234.22/24\nb=CT:1000\nt=11111 22222\nr=7d 1h 0 25h\nz=2882844526 -1h 2898848070 0\n",
|
111
|
+
"v=1\no=steve 1234 5555 IN IP4 123.33.22.123\ns=This is a test session\ni=And here's some info\nu=http://bobo.net/thispdf.pdf\ne=bob@thing.com (Bob!)\np=+1 555 123 0987\nc=IN IP4 224.5.234.22/24\nb=CT:1000\nt=11111 22222\nr=7d 1h 0 25h\nz=2882844526 -1h\n",
|
112
|
+
"v=1\no=steve 1234 5555 IN IP4 123.33.22.123\ns=This is a test session\ni=And here's some info\nu=http://bobo.net/thispdf.pdf\ne=bob@thing.com (Bob!)\np=+1 555 123 0987\nc=IN IP4 224.5.234.22/24\nb=CT:1000\nt=11111 22222\nr=7d 1h 0 25h\n",
|
113
|
+
"v=1\no=steve 1234 5555 IN IP4 123.33.22.123\ns=This is a test session\ni=And here's some info\nu=http://bobo.net/thispdf.pdf\ne=bob@thing.com (Bob!)\np=+1 555 123 0987\nc=IN IP4 224.5.234.22/24\nb=CT:1000\nt=11111 22222\n",
|
114
|
+
"v=1\no=steve 1234 5555 IN IP4 123.33.22.123\ns=This is a test session\ni=And here's some info\nu=http://bobo.net/thispdf.pdf\ne=bob@thing.com (Bob!)\np=+1 555 123 0987\nc=IN IP4 224.5.234.22/24\nt=11111 22222\n",
|
115
|
+
"v=1\no=steve 1234 5555 IN IP4 123.33.22.123\ns=This is a test session\ni=And here's some info\nu=http://bobo.net/thispdf.pdf\ne=bob@thing.com (Bob!)\nc=IN IP4 224.5.234.22/24\nt=11111 22222\n",
|
116
|
+
"v=1\no=steve 1234 5555 IN IP4 123.33.22.123\ns=This is a test session\ni=And here's some info\nu=http://bobo.net/thispdf.pdf\nc=IN IP4 224.5.234.22/24\nt=11111 22222\n",
|
117
|
+
"v=1\no=steve 1234 5555 IN IP4 123.33.22.123\ns=This is a test session\ni=And here's some info\nc=IN IP4 224.5.234.22/24\nt=11111 22222\n",
|
118
|
+
#BANDWIDTH_BETWEEN_ATTRIBUTES
|
119
|
+
]
|
120
|
+
end
|
121
|
+
|
122
|
+
it "successfully parses and is valid" do
|
123
|
+
valid_sdps.each do |sdp|
|
124
|
+
result = subject.should parse(sdp)
|
125
|
+
result.should be_a_valid_description
|
126
|
+
end
|
127
|
+
end
|
128
|
+
end
|
129
|
+
end
|
data/spec/spec_helper.rb
CHANGED
@@ -4,4 +4,5 @@ SimpleCov.start
|
|
4
4
|
$:.unshift(File.dirname(__FILE__) + '/../lib')
|
5
5
|
require 'sdp/version'
|
6
6
|
|
7
|
-
|
7
|
+
Dir[File.dirname(__FILE__) + "/support/**/*.rb"].each { |f| require f }
|
8
|
+
include TestDescriptions
|
@@ -0,0 +1,33 @@
|
|
1
|
+
RSpec::Matchers.define :parse do |expected|
|
2
|
+
match do
|
3
|
+
begin
|
4
|
+
result = SDP::Parser.new.parse(expected)
|
5
|
+
rescue Parslet::ParseFailed => ex
|
6
|
+
puts ex
|
7
|
+
raise
|
8
|
+
end
|
9
|
+
|
10
|
+
result
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
RSpec::Matchers.define :be_a_valid_description do |expected|
|
15
|
+
match do |actual|
|
16
|
+
@result = if actual.is_a? SDP::Description
|
17
|
+
actual
|
18
|
+
else
|
19
|
+
SDP::Description.new(actual)
|
20
|
+
end
|
21
|
+
|
22
|
+
@result.valid?
|
23
|
+
end
|
24
|
+
|
25
|
+
failure_message_for_should do
|
26
|
+
"Expected had errors: #{@result.errors}"
|
27
|
+
end
|
28
|
+
|
29
|
+
failure_message_for_should_not do
|
30
|
+
"Expected description not be valid, but it was. #{@result.inspect}"
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
File without changes
|
@@ -0,0 +1,137 @@
|
|
1
|
+
module TestDescriptions
|
2
|
+
REQUIRED_ONLY = %{v=0\r
|
3
|
+
o=guy 1234 5555 IN IP4 123.33.22.123\r
|
4
|
+
s=This is a test session\r
|
5
|
+
c=IN IP4 0.0.0.0\r
|
6
|
+
t=11111 22222\r
|
7
|
+
}
|
8
|
+
|
9
|
+
#-------------------------------------------------------------------------------
|
10
|
+
# Missing lines
|
11
|
+
#-------------------------------------------------------------------------------
|
12
|
+
NO_VERSION = %{o=- 1809368942 3379601213 IN IP4 127.0.0.1\r
|
13
|
+
s=Test session\r
|
14
|
+
c=IN IP4 0.0.0.0\r
|
15
|
+
t=0 0\r
|
16
|
+
}
|
17
|
+
|
18
|
+
NO_ORIGIN = %{v=0\r
|
19
|
+
s=Test session\r
|
20
|
+
c=IN IP4 0.0.0.0\r
|
21
|
+
t=0 0\r
|
22
|
+
}
|
23
|
+
|
24
|
+
NO_NAME = %{v=0\r
|
25
|
+
o=- 1809368942 3379601213 IN IP4 127.0.0.1\r
|
26
|
+
c=IN IP4 0.0.0.0\r
|
27
|
+
t=0 0\r
|
28
|
+
}
|
29
|
+
|
30
|
+
NO_CONNECT = %{v=0\r
|
31
|
+
o=guy 1234 5555 IN IP4 123.33.22.123\r
|
32
|
+
s=This is a test session\r
|
33
|
+
t=11111 22222\r
|
34
|
+
}
|
35
|
+
|
36
|
+
NO_TIMING = %{v=0\r
|
37
|
+
o=- 1809368942 3379601213 IN IP4 127.0.0.1\r
|
38
|
+
s=Test session\r
|
39
|
+
c=IN IP4 0.0.0.0\r
|
40
|
+
}
|
41
|
+
|
42
|
+
|
43
|
+
TWO_TIME_DESCRIPTIONS = %{v=0\r
|
44
|
+
o=user 1809368942 3379601213 IN IP4 127.0.0.1\r
|
45
|
+
s=Test session\r
|
46
|
+
t=0 0\r
|
47
|
+
t=1 2\r
|
48
|
+
}
|
49
|
+
|
50
|
+
ONE_MEDIA_SECTION_NO_CONNECT = %{v=0\r
|
51
|
+
o=person 1809368942 3379601213 IN IP4 127.0.0.1\r
|
52
|
+
s=Test session\r
|
53
|
+
t=1234 5678\r
|
54
|
+
m=audio 0 RTP/AVP 96\r
|
55
|
+
}
|
56
|
+
|
57
|
+
ONE_MEDIA_SECTION_CONNECT_IN_SESSION = %{v=0\r
|
58
|
+
o=person 1809368942 3379601213 IN IP4 127.0.0.1\r
|
59
|
+
s=Test session\r
|
60
|
+
c=IN IP4 0.0.0.0\r
|
61
|
+
t=1234 5678\r
|
62
|
+
m=audio 0 RTP/AVP 96\r
|
63
|
+
}
|
64
|
+
|
65
|
+
ONE_MEDIA_SECTION_CONNECT_IN_MEDIA = %{v=0\r
|
66
|
+
o=person 1809368942 3379601213 IN IP4 127.0.0.1\r
|
67
|
+
s=Test session\r
|
68
|
+
t=1234 5678\r
|
69
|
+
m=audio 0 RTP/AVP 96\r
|
70
|
+
c=IN IP4 0.0.0.0\r
|
71
|
+
}
|
72
|
+
|
73
|
+
TWO_MEDIA_SECTIONS_NO_CONNECT = %{v=0\r
|
74
|
+
o=person 1809368942 3379601213 IN IP4 127.0.0.1\r
|
75
|
+
s=Test session\r
|
76
|
+
t=1234 5678\r
|
77
|
+
m=audio 0 RTP/AVP 96\r
|
78
|
+
m=audio 0 RTP/AVP 97\r
|
79
|
+
}
|
80
|
+
|
81
|
+
TWO_MEDIA_SECTIONS_CONNECT_IN_SESSION = %{v=0\r
|
82
|
+
o=person 1809368942 3379601213 IN IP4 127.0.0.1\r
|
83
|
+
s=Test session\r
|
84
|
+
c=IN IP4 0.0.0.0\r
|
85
|
+
t=1234 5678\r
|
86
|
+
m=audio 0 RTP/AVP 96\r
|
87
|
+
m=audio 0 RTP/AVP 97\r
|
88
|
+
}
|
89
|
+
|
90
|
+
TWO_MEDIA_SECTIONS_CONNECT_IN_MEDIA = %{v=0\r
|
91
|
+
o=person 1809368942 3379601213 IN IP4 127.0.0.1\r
|
92
|
+
s=Test session\r
|
93
|
+
t=1234 5678\r
|
94
|
+
m=audio 0 RTP/AVP 96\r
|
95
|
+
c=IN IP4 0.0.0.0\r
|
96
|
+
m=audio 0 RTP/AVP 97\r
|
97
|
+
c=IN IP4 0.0.0.0\r
|
98
|
+
}
|
99
|
+
|
100
|
+
SDP_MISSING_TIME = %Q{v=0\r
|
101
|
+
o=- 1809368942 3379601213 IN IP4 127.0.0.1\r
|
102
|
+
s=Secret Agent from SomaFM\r
|
103
|
+
i=Downtempo Spy Lounge\r
|
104
|
+
c=IN IP4 0.0.0.0\r
|
105
|
+
t=0 0\r
|
106
|
+
a=x-qt-text-cmt:Orban Opticodec-PCx-qt-text-nam:Secret Agent from SomaFMx-qt-text-inf:Downtempo Spy Loungecontrol:*\r
|
107
|
+
m=audio 0 RTP/AVP 96\r
|
108
|
+
a=rtpmap:96 MP4A-LATM/44100/2a=fmtp:96 cpresent=0;config=400027200000a=control:trackID=1\r
|
109
|
+
}
|
110
|
+
|
111
|
+
BANDWIDTH_BETWEEN_ATTRIBUTES = %{v=0\r
|
112
|
+
o=- 1729430249 1729430249 IN IP4 127.0.0.0\r
|
113
|
+
s=Wirecast\r
|
114
|
+
c=IN IP4 0.0.0.0\r
|
115
|
+
t=0 0\r
|
116
|
+
a=x-qt-text-nam:ACT Legislative Assembly\r
|
117
|
+
a=x-qt-text-cpy:Copyright ACT 2010\r
|
118
|
+
a=x-qt-text-aut:ACT Government\r
|
119
|
+
a=x-qt-text-inf:http://www.parliament.act.gov.au\r
|
120
|
+
a=range:npt=now-\r
|
121
|
+
a=control:*\r
|
122
|
+
m=audio 0 RTP/AVP 96\r
|
123
|
+
a=3GPP-Adaptation-Support:1\r
|
124
|
+
a=rtpmap:96 mpeg4-generic/32000/2\r
|
125
|
+
a=fmtp:96 profile-level-id=15;mode=AAC-hbr;sizelength=13;indexlength=3;indexdeltalength=3;config=1290\r
|
126
|
+
a=control:trackID=1\r
|
127
|
+
m=video 0 RTP/AVP 97\r
|
128
|
+
a=3GPP-Adaptation-Support:1\r
|
129
|
+
a=rtpmap:97 H264/90000\r
|
130
|
+
a=fmtp:97 packetization-mode=1;profile-level-id=4D400D;sprop-parameter-sets=J01ADakYKD5gDUGAQa2wrXvfAQ==,KN4JiA==\r
|
131
|
+
a=cliprect:0,0,240,320\r
|
132
|
+
a=framesize:97 320-240\r
|
133
|
+
b=AS:256\r
|
134
|
+
a=control:trackID=2\r
|
135
|
+
}
|
136
|
+
end
|
137
|
+
|