ruby_rabbitmq_janus 2.5.1 → 2.6.0.pre.226
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/bin/ruby_rabbitmq_janus +67 -0
- data/config/default.md +3 -0
- data/config/default.yml +6 -0
- data/lib/rrj/binary.rb +56 -0
- data/lib/rrj/errors/rabbit/base_event.rb +21 -0
- data/lib/rrj/errors/rabbit/listener/base.rb +29 -0
- data/lib/rrj/errors/rabbit/listener/from.rb +17 -0
- data/lib/rrj/errors/rabbit/listener/from_admin.rb +17 -0
- data/lib/rrj/errors/rabbit/listener/janus_instance.rb +17 -0
- data/lib/rrj/errors/rabbit/publisher/admin.rb +32 -0
- data/lib/rrj/errors/rabbit/publisher/base.rb +31 -0
- data/lib/rrj/errors/rabbit/publisher/exclusive.rb +33 -0
- data/lib/rrj/errors/rabbit/publisher/janus_instance.rb +23 -0
- data/lib/rrj/errors/rabbit/publisher/keepalive.rb +17 -0
- data/lib/rrj/errors/rabbit/publisher/non_exclusive.rb +33 -0
- data/lib/rrj/errors/rabbit/rabbit.rb +12 -6
- data/lib/rrj/info.rb +6 -5
- data/lib/rrj/init.rb +2 -2
- data/lib/rrj/janus/messages/message.rb +1 -1
- data/lib/rrj/janus/processus/event.rb +1 -1
- data/lib/rrj/janus/processus/keepalive/keepalive_thread.rb +3 -2
- data/lib/rrj/janus/responses/janus_instance.rb +28 -0
- data/lib/rrj/janus/responses/response.rb +1 -1
- data/lib/rrj/janus/transactions/admin.rb +1 -1
- data/lib/rrj/janus/transactions/handle.rb +1 -1
- data/lib/rrj/janus/transactions/transaction.rb +2 -2
- data/lib/rrj/models/concerns/janus_instance_callbacks.rb +9 -5
- data/lib/rrj/models/concerns/janus_instance_methods.rb +12 -0
- data/lib/rrj/rabbit/base_event.rb +47 -0
- data/lib/rrj/rabbit/connect.rb +12 -12
- data/lib/rrj/rabbit/{publish/listener.rb → listener/base.rb} +16 -18
- data/lib/rrj/rabbit/listener/from.rb +30 -0
- data/lib/rrj/rabbit/{publish/listener_admin.rb → listener/from_admin.rb} +6 -4
- data/lib/rrj/rabbit/listener/janus_instance.rb +36 -0
- data/lib/rrj/rabbit/{publish/publisher_admin.rb → publisher/admin.rb} +5 -10
- data/lib/rrj/rabbit/{publish/publisher.rb → publisher/base.rb} +10 -8
- data/lib/rrj/rabbit/{publish → publisher}/exclusive.rb +3 -3
- data/lib/rrj/rabbit/publisher/janus_instance.rb +27 -0
- data/lib/rrj/rabbit/{publish → publisher}/keepalive.rb +4 -2
- data/lib/rrj/rabbit/{publish → publisher}/non_exclusive.rb +3 -7
- data/lib/rrj/rabbit/rabbit.rb +1 -1
- data/lib/rrj/tools/gem/cluster.rb +0 -17
- data/lib/rrj/tools/gem/config.rb +9 -0
- data/lib/rrj/tools/gem/log.rb +3 -4
- data/lib/rrj/tools/gem/option.rb +2 -12
- data/lib/rrj/tools/replaces/admin.rb +4 -4
- data/lib/rrj/tools/replaces/handle.rb +6 -6
- data/lib/rrj/tools/replaces/replace.rb +6 -6
- data/lib/rrj/tools/replaces/session.rb +4 -4
- data/spec/factories/janus_instance.rb +1 -1
- data/spec/request/admin/request_allow_token_spec.rb +1 -0
- data/spec/request/admin/request_disallow_token_spec.rb +1 -0
- data/spec/request/admin/request_handle_info_spec.rb +1 -0
- data/spec/request/admin/request_list_handles_spec.rb +1 -0
- data/spec/request/admin/request_list_sessions_spec.rb +1 -0
- data/spec/request/admin/request_start_pcap_spec.rb +1 -0
- data/spec/request/admin/request_start_text2pcap_spec.rb +1 -0
- data/spec/request/admin/request_stop_pcap_spec.rb +1 -0
- data/spec/request/admin/request_stop_text2pcap_spec.rb +1 -0
- data/spec/request/base/request_attach_spec.rb +1 -1
- data/spec/request/base/request_create_spec.rb +2 -2
- data/spec/request/base/request_destroy_spec.rb +1 -1
- data/spec/request/base/request_detach_spec.rb +1 -1
- data/spec/request/base/request_info_spec.rb +2 -2
- data/spec/request/base/request_keepalive_spec.rb +1 -1
- data/spec/request/peer/request_offer_spec.rb +1 -1
- data/spec/request/peer/request_trickle_spec.rb +1 -1
- data/spec/request/peer/request_trickles_spec.rb +1 -1
- data/spec/rrj/{rrj_spec.rb → ruby_rabbitmq_janus_spec.rb} +21 -11
- data/spec/{thread/concurencies_spec.rb → ruby_rabbitmq_janus/janus/concurrencies/concurrency_spec.rb} +1 -1
- data/spec/{thread → ruby_rabbitmq_janus/janus/concurrencies}/keepalive_initializer_spec.rb +3 -2
- data/spec/{thread → ruby_rabbitmq_janus/janus/concurrencies}/keepalive_thread_spec.rb +3 -3
- data/spec/{thread → ruby_rabbitmq_janus/janus/concurrencies}/keepalive_timer_spec.rb +1 -1
- data/spec/{rrj/messages/messages_admin_spec.rb → ruby_rabbitmq_janus/janus/messages/admin_spec.rb} +1 -1
- data/spec/{rrj/messages/messages_message_spec.rb → ruby_rabbitmq_janus/janus/messages/message_spec.rb} +2 -1
- data/spec/{rrj/messages/messages_standard_spec.rb → ruby_rabbitmq_janus/janus/messages/standard_spec.rb} +1 -1
- data/spec/{rrj/responses/responses_admin_spec.rb → ruby_rabbitmq_janus/janus/responses/admin_spec.rb} +1 -1
- data/spec/{rrj/responses/responses_event_spec.rb → ruby_rabbitmq_janus/janus/responses/event_spec.rb} +3 -2
- data/spec/{rrj/responses/responses_response_spec.rb → ruby_rabbitmq_janus/janus/responses/response_spec.rb} +3 -3
- data/spec/{rrj/responses/responses_standard_spec.rb → ruby_rabbitmq_janus/janus/responses/standard_spec.rb} +4 -3
- data/spec/{rrj → ruby_rabbitmq_janus}/models/janus_instance_definition_spec.rb +2 -2
- data/spec/{rrj/models/janus_instance_transaction_spec.rb → ruby_rabbitmq_janus/models/janus_instance_spec.rb} +10 -9
- data/spec/{rrj → ruby_rabbitmq_janus}/rabbit/connect_spec.rb +1 -1
- data/spec/ruby_rabbitmq_janus/rabbit/listener/from_spec.rb +15 -0
- data/spec/{rrj → ruby_rabbitmq_janus}/rabbit/propertie_2_spec.rb +3 -3
- data/spec/{rrj → ruby_rabbitmq_janus}/rabbit/propertie_spec.rb +3 -3
- data/spec/ruby_rabbitmq_janus/rabbit/publisher/admin_spec.rb +12 -0
- data/spec/{rrj/rabbit/publish/base_publisher_spec.rb → ruby_rabbitmq_janus/rabbit/publisher/base_spec.rb} +3 -3
- data/spec/{rrj/rabbit/publish → ruby_rabbitmq_janus/rabbit/publisher}/exclusive_spec.rb +0 -0
- data/spec/{rrj/rabbit/publish → ruby_rabbitmq_janus/rabbit/publisher}/non_exclusive_spec.rb +0 -0
- data/spec/{rrj/tools/gem/rrj_cluster_spec.rb → ruby_rabbitmq_janus/tools/cluster_spec.rb} +1 -21
- data/spec/{rrj/tools/gem/rrj_config_spec.rb → ruby_rabbitmq_janus/tools/config_spec.rb} +26 -14
- data/spec/{rrj/tools/gem/rrj_log_spec.rb → ruby_rabbitmq_janus/tools/log_spec.rb} +10 -10
- data/spec/{rrj/tools/replace/replace_admin_spec.rb → ruby_rabbitmq_janus/tools/replaces/admin_spec.rb} +15 -15
- data/spec/{rrj/tools/replace/replace_handle_spec.rb → ruby_rabbitmq_janus/tools/replaces/handle_spec.rb} +14 -14
- data/spec/{rrj/tools/replace → ruby_rabbitmq_janus/tools/replaces}/replace_spec.rb +16 -17
- data/spec/{rrj/tools/replace/replace_session_spec.rb → ruby_rabbitmq_janus/tools/replaces/session_spec.rb} +14 -14
- data/spec/{rrj/tools/replace → ruby_rabbitmq_janus/tools}/type_spec.rb +19 -19
- data/spec/spec_helper.rb +1 -1
- data/spec/support/examples_request.rb +1 -1
- data/spec/support/type.rb +3 -3
- metadata +83 -59
- data/lib/rrj/errors/rabbit/publish/admin.rb +0 -30
- data/lib/rrj/errors/rabbit/publish/base_publisher.rb +0 -23
- data/lib/rrj/errors/rabbit/publish/exclusive.rb +0 -31
- data/lib/rrj/errors/rabbit/publish/listener.rb +0 -30
- data/lib/rrj/errors/rabbit/publish/non_exclusive.rb +0 -31
- data/lib/rrj/errors/rabbit/publish/publisher.rb +0 -38
- data/lib/rrj/rabbit/publish/base_publisher.rb +0 -50
- data/spec/rrj/rabbit/publish/admin_spec.rb +0 -12
- data/spec/rrj/rabbit/publish/listener_spec.rb +0 -15
- data/spec/rrj/rabbit/publish/publisher_spec.rb +0 -13
@@ -4,7 +4,7 @@ require 'spec_helper'
|
|
4
4
|
|
5
5
|
describe RubyRabbitmqJanus::Rabbit::Connect, type: :rabbit,
|
6
6
|
name: :connect do
|
7
|
-
let(:connect) {
|
7
|
+
let(:connect) { described_class.new }
|
8
8
|
|
9
9
|
describe '#start' do
|
10
10
|
it { expect(connect.start.class).to eq(Bunny::Session) }
|
@@ -0,0 +1,15 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'spec_helper'
|
4
|
+
|
5
|
+
describe RubyRabbitmqJanus::Rabbit::Listener::From, type: :rabbit,
|
6
|
+
name: :listener do
|
7
|
+
let(:publish) do
|
8
|
+
rabbit = RubyRabbitmqJanus::Rabbit::Connect.new.rabbit
|
9
|
+
described_class.new(rabbit)
|
10
|
+
end
|
11
|
+
|
12
|
+
# @todo Complete spec publisher listener
|
13
|
+
describe 'Listener from' do
|
14
|
+
end
|
15
|
+
end
|
@@ -4,21 +4,21 @@ require 'spec_helper'
|
|
4
4
|
|
5
5
|
describe RubyRabbitmqJanus::Rabbit::Propertie, type: :rabbit,
|
6
6
|
name: :propertie do
|
7
|
-
let(:rabbit) {
|
7
|
+
let(:rabbit) { described_class.new }
|
8
8
|
|
9
9
|
describe '#options' do
|
10
10
|
it { expect(rabbit.options).to match_json_schema(:rabbit_options) }
|
11
11
|
end
|
12
12
|
|
13
13
|
describe '#options_admin', broken: true do
|
14
|
-
context '
|
14
|
+
context 'when admin request' do
|
15
15
|
it do
|
16
16
|
expect(rabbit.options_admin('admin::sessions')).to \
|
17
17
|
match_json_schema(:rabbit_options_admin)
|
18
18
|
end
|
19
19
|
end
|
20
20
|
|
21
|
-
context '
|
21
|
+
context 'when base request' do
|
22
22
|
it do
|
23
23
|
expect(rabbit.options_admin('request::create')).to \
|
24
24
|
match_json_schema(:rabbit_options)
|
@@ -5,21 +5,21 @@ require 'spec_helper'
|
|
5
5
|
describe RubyRabbitmqJanus::Rabbit::Propertie, type: :rabbit,
|
6
6
|
name: :propertie,
|
7
7
|
instances: true do
|
8
|
-
let(:rabbit) {
|
8
|
+
let(:rabbit) { described_class.new(2) }
|
9
9
|
|
10
10
|
describe '#options' do
|
11
11
|
it { expect(rabbit.options).to match_json_schema(:rabbit_options2) }
|
12
12
|
end
|
13
13
|
|
14
14
|
describe '#options_admin', broken: true do
|
15
|
-
context '
|
15
|
+
context 'when admin request' do
|
16
16
|
it do
|
17
17
|
expect(rabbit.options_admin('admin::sessions')).to \
|
18
18
|
match_json_schema(:rabbit_options_admin2)
|
19
19
|
end
|
20
20
|
end
|
21
21
|
|
22
|
-
context '
|
22
|
+
context 'when base request' do
|
23
23
|
it do
|
24
24
|
expect(rabbit.options_admin('request::create')).to \
|
25
25
|
match_json_schema(:rabbit_options2)
|
@@ -0,0 +1,12 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'spec_helper'
|
4
|
+
|
5
|
+
describe RubyRabbitmqJanus::Rabbit::Publisher::Admin, type: :rabbit,
|
6
|
+
name: :publisher_admin do
|
7
|
+
let(:pusblish) { described_class.new }
|
8
|
+
|
9
|
+
# @todo Complete test publisherAdmin
|
10
|
+
describe 'Admin' do
|
11
|
+
end
|
12
|
+
end
|
@@ -3,10 +3,10 @@
|
|
3
3
|
require 'spec_helper'
|
4
4
|
|
5
5
|
describe RubyRabbitmqJanus::Rabbit::Publisher, type: :rabbit,
|
6
|
-
name: :
|
7
|
-
let(:publish) { RubyRabbitmqJanus::Rabbit::
|
6
|
+
name: :base_event do
|
7
|
+
let(:publish) { RubyRabbitmqJanus::Rabbit::BaseEvent.new }
|
8
8
|
|
9
|
-
describe '
|
9
|
+
describe 'BaseEvent' do
|
10
10
|
describe '#new' do
|
11
11
|
it { expect(publish).to have_attributes(responses: []) }
|
12
12
|
end
|
File without changes
|
File without changes
|
@@ -3,7 +3,7 @@
|
|
3
3
|
require 'spec_helper'
|
4
4
|
|
5
5
|
describe RubyRabbitmqJanus::Tools::Cluster, type: :tools, name: :cluster do
|
6
|
-
let(:cluster) {
|
6
|
+
let(:cluster) { described_class.instance }
|
7
7
|
let(:model) { RubyRabbitmqJanus::Models::JanusInstance }
|
8
8
|
let(:number_of_instance) { Random.new.rand(100) }
|
9
9
|
let(:name_queue) { "to-janus-#{number_of_instance}" }
|
@@ -16,24 +16,4 @@ describe RubyRabbitmqJanus::Tools::Cluster, type: :tools, name: :cluster do
|
|
16
16
|
it do
|
17
17
|
expect(cluster.queue_admin_to(number_of_instance)).to eql(name_queue_admin)
|
18
18
|
end
|
19
|
-
|
20
|
-
it do
|
21
|
-
expect { cluster.create_session }.not_to raise_error
|
22
|
-
end
|
23
|
-
|
24
|
-
it do
|
25
|
-
expect { cluster.restart_session }.not_to raise_error
|
26
|
-
end
|
27
|
-
|
28
|
-
context 'When active record is loaded', orm: :active_record do
|
29
|
-
it do
|
30
|
-
expect(cluster.create_session).to be_a(model)
|
31
|
-
end
|
32
|
-
end
|
33
|
-
|
34
|
-
context 'When mongoid is loaded', orm: :mongoid do
|
35
|
-
it do
|
36
|
-
expect(cluster.create_session).to be_a(model)
|
37
|
-
end
|
38
|
-
end
|
39
19
|
end
|
@@ -3,71 +3,83 @@
|
|
3
3
|
require 'spec_helper'
|
4
4
|
|
5
5
|
describe RubyRabbitmqJanus::Tools::Config, type: :tools, name: :config do
|
6
|
-
before(:context) { @cfg =
|
6
|
+
before(:context) { @cfg = described_class.instance }
|
7
7
|
|
8
8
|
it 'When file is correct' do
|
9
9
|
expect(@cfg.options).to match_json_schema(:config)
|
10
10
|
end
|
11
11
|
|
12
|
-
context 'janus/session/keepalive' do
|
13
|
-
context 'method time_to_live' do
|
12
|
+
context 'when janus/session/keepalive' do
|
13
|
+
context 'with method time_to_live' do
|
14
14
|
let(:method) { @cfg.time_to_live }
|
15
|
+
|
15
16
|
it_behaves_like 'type and default value', Integer, 55
|
16
17
|
end
|
17
18
|
|
18
|
-
context 'method alias ttl' do
|
19
|
+
context 'with method alias ttl' do
|
19
20
|
let(:method) { @cfg.ttl }
|
21
|
+
|
20
22
|
it_behaves_like 'type and default value', Integer, 55
|
21
23
|
end
|
22
24
|
end
|
23
25
|
|
24
|
-
context 'janus/plugins/0' do
|
26
|
+
context 'when janus/plugins/0' do
|
25
27
|
let(:method) { @cfg.plugin_at }
|
28
|
+
|
26
29
|
it_behaves_like 'type and default value', String, 'janus.plugin.echotest'
|
27
30
|
end
|
28
31
|
|
29
|
-
context 'janus/plugins/1' do
|
32
|
+
context 'when janus/plugins/1' do
|
30
33
|
let(:method) { @cfg.plugin_at(1) }
|
34
|
+
|
31
35
|
it_behaves_like 'type and default value', String, 'janus.plugin.videoroom'
|
32
36
|
end
|
33
37
|
|
34
|
-
context 'janus/plugins/2' do
|
38
|
+
context 'when janus/plugins/2' do
|
35
39
|
let(:method) { @cfg.plugin_at(2) }
|
40
|
+
|
36
41
|
it_behaves_like 'type and default value', String, 'janus.plugin.sip'
|
37
42
|
end
|
38
43
|
|
39
|
-
context 'janus/plugins/3' do
|
44
|
+
context 'when janus/plugins/3' do
|
40
45
|
let(:method) { @cfg.plugin_at(3) }
|
46
|
+
|
41
47
|
it_behaves_like 'type and default value', String, ''
|
42
48
|
end
|
43
49
|
|
44
|
-
context 'gem/cluster/enabled' do
|
50
|
+
context 'when gem/cluster/enabled' do
|
45
51
|
let(:method) { @cfg.cluster }
|
52
|
+
|
46
53
|
it_behaves_like 'type and default value', FalseClass, false
|
47
54
|
end
|
48
55
|
|
49
|
-
context 'queues/standard/from' do
|
56
|
+
context 'when queues/standard/from' do
|
50
57
|
let(:method) { @cfg.queue_from }
|
58
|
+
|
51
59
|
it_behaves_like 'type and default value', String, 'from-janus'
|
52
60
|
end
|
53
61
|
|
54
|
-
context 'queues/standard/to' do
|
62
|
+
context 'when queues/standard/to' do
|
55
63
|
let(:method) { @cfg.queue_to }
|
64
|
+
|
56
65
|
it_behaves_like 'type and default value', String, 'to-janus'
|
57
66
|
end
|
58
67
|
|
59
|
-
context 'queues/admin/from' do
|
68
|
+
context 'when queues/admin/from' do
|
60
69
|
let(:method) { @cfg.queue_admin_from }
|
70
|
+
|
61
71
|
it_behaves_like 'type and default value', String, 'from-janus-admin'
|
62
72
|
end
|
63
73
|
|
64
|
-
context 'queues/admin/to' do
|
74
|
+
context 'when queues/admin/to' do
|
65
75
|
let(:method) { @cfg.queue_admin_to }
|
76
|
+
|
66
77
|
it_behaves_like 'type and default value', String, 'to-janus-admin'
|
67
78
|
end
|
68
79
|
|
69
|
-
context 'gem/log/level' do
|
80
|
+
context 'when gem/log/level' do
|
70
81
|
let(:method) { @cfg.log_level }
|
82
|
+
|
71
83
|
it_behaves_like 'type and default value', Symbol, :DEBUG
|
72
84
|
end
|
73
85
|
end
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
require 'spec_helper'
|
4
4
|
|
5
|
-
describe
|
5
|
+
describe RubyRabbitmqJanus::Tools::Log, type: :tools, name: :log do
|
6
6
|
let(:levels) do
|
7
7
|
{
|
8
8
|
DEBUG: Logger::DEBUG,
|
@@ -14,8 +14,8 @@ describe 'RubyRabbitmqJanus::Log', type: :tools, name: :log do
|
|
14
14
|
}
|
15
15
|
end
|
16
16
|
let(:sensitives) { %i[admin_secret apisecret] }
|
17
|
-
let(:log) {
|
18
|
-
let(:log_constant) {
|
17
|
+
let(:log) { described_class.instance }
|
18
|
+
let(:log_constant) { described_class }
|
19
19
|
let(:new_level) { Random.new.rand(5) }
|
20
20
|
let(:message) { '## test ##' }
|
21
21
|
let(:last_line) { IO.readlines('log/ruby-rabbitmq-janus.log')[-1..-1][0] }
|
@@ -42,40 +42,40 @@ describe 'RubyRabbitmqJanus::Log', type: :tools, name: :log do
|
|
42
42
|
context 'when write a message unknown' do
|
43
43
|
before { log.unknown(message) }
|
44
44
|
|
45
|
-
it { expect(last_line).to include('A,
|
45
|
+
it { expect(last_line).to include('A, ## test ##') }
|
46
46
|
end
|
47
47
|
|
48
48
|
context 'when write a message fatal' do
|
49
49
|
before { log.fatal(message) }
|
50
50
|
|
51
|
-
it { expect(last_line).to include('F,
|
51
|
+
it { expect(last_line).to include('F, ## test ##') }
|
52
52
|
end
|
53
53
|
|
54
54
|
context 'when write a message error' do
|
55
55
|
before { log.error(message) }
|
56
56
|
|
57
|
-
it { expect(last_line).to include('E,
|
57
|
+
it { expect(last_line).to include('E, ## test ##') }
|
58
58
|
end
|
59
59
|
|
60
60
|
context 'when write a message warn' do
|
61
61
|
before { log.warn(message) }
|
62
62
|
|
63
|
-
it { expect(last_line).to include('W,
|
63
|
+
it { expect(last_line).to include('W, ## test ##') }
|
64
64
|
end
|
65
65
|
|
66
66
|
context 'when write a message info' do
|
67
67
|
before { log.info(message) }
|
68
68
|
|
69
|
-
it { expect(last_line).to include('I,
|
69
|
+
it { expect(last_line).to include('I, ## test ##') }
|
70
70
|
end
|
71
71
|
|
72
72
|
context 'when write a message debug' do
|
73
73
|
before { log.debug(message) }
|
74
74
|
|
75
|
-
it { expect(last_line).to include('D,
|
75
|
+
it { expect(last_line).to include('D, ## test ##') }
|
76
76
|
end
|
77
77
|
|
78
|
-
context '
|
78
|
+
context 'when level is changed' do
|
79
79
|
it 'Change level' do
|
80
80
|
expect(log.save_level(new_level)).to eql(log.level)
|
81
81
|
end
|
@@ -2,16 +2,15 @@
|
|
2
2
|
|
3
3
|
require 'spec_helper'
|
4
4
|
|
5
|
-
describe
|
5
|
+
describe RubyRabbitmqJanus::Tools::Replaces::Admin, type: :tools, name: :replace_admin do
|
6
6
|
subject(:replace) do
|
7
7
|
# Get request JSON file
|
8
8
|
rqe = RubyRabbitmqJanus::Tools::Requests.instance.requests['test::replace']
|
9
9
|
# Open request file
|
10
|
-
|
11
|
-
options)
|
10
|
+
described_class.new(JSON.parse(File.read(rqe)), options)
|
12
11
|
end
|
13
12
|
|
14
|
-
context 'replace classic element' do
|
13
|
+
context 'when replace classic element' do
|
15
14
|
let(:opt_session) { Random.rand(123_456_789..987_654_321) }
|
16
15
|
let(:opt_handle) { Random.rand(123_456_789..987_654_321) }
|
17
16
|
let(:opt_plugin) { 'janus.plugin.echotest' }
|
@@ -36,50 +35,51 @@ describe 'RubyRabbitmqJanus::Log', type: :tools, name: :replace_admin do
|
|
36
35
|
}
|
37
36
|
end
|
38
37
|
|
39
|
-
context '
|
38
|
+
context 'with ransform request' do
|
40
39
|
it do
|
41
40
|
expect(replace.transform_request).to be_kind_of(Hash)
|
42
41
|
end
|
43
42
|
end
|
44
43
|
|
45
|
-
context '
|
44
|
+
context 'with ransform request session_id' do
|
46
45
|
include_examples 'test replace in request', 'session_id', Integer
|
47
46
|
end
|
48
47
|
|
49
|
-
context '
|
48
|
+
context 'with ransform request transaction' do
|
50
49
|
include_examples 'test replace in request nil', 'transaction'
|
51
50
|
end
|
52
51
|
|
53
|
-
context '
|
52
|
+
context 'with ransform request handle_id' do
|
54
53
|
include_examples 'test replace in request', 'handle_id', Integer
|
55
54
|
end
|
56
55
|
|
57
|
-
context '
|
56
|
+
context 'with ransform request plugin' do
|
58
57
|
include_examples 'test replace in request', 'plugin', String
|
59
58
|
end
|
60
59
|
|
61
|
-
context '
|
60
|
+
context 'with ransform request candidates' do
|
62
61
|
include_examples 'test replace in request', 'candidates', Array
|
63
62
|
end
|
64
63
|
|
65
|
-
context '
|
64
|
+
context 'with ransform request audio' do
|
66
65
|
include_examples 'test replace in request nil', 'audio'
|
67
66
|
end
|
68
67
|
|
69
|
-
context '
|
68
|
+
context 'with ransform request sdp' do
|
70
69
|
let(:key) { 'jsep' }
|
70
|
+
|
71
71
|
include_examples 'test replace in request', 'sdp', String
|
72
72
|
end
|
73
73
|
|
74
|
-
context '
|
74
|
+
context 'with ransform request debug' do
|
75
75
|
include_examples 'test replace in request', 'debug', TrueClass
|
76
76
|
end
|
77
77
|
|
78
|
-
context '
|
78
|
+
context 'with ransform request level' do
|
79
79
|
include_examples 'test replace in request', 'level', Integer
|
80
80
|
end
|
81
81
|
|
82
|
-
context '
|
82
|
+
context 'with ransform request transaction' do
|
83
83
|
include_examples 'test replace in request nil', 'admin_secret'
|
84
84
|
end
|
85
85
|
end
|
@@ -2,16 +2,15 @@
|
|
2
2
|
|
3
3
|
require 'spec_helper'
|
4
4
|
|
5
|
-
describe
|
5
|
+
describe RubyRabbitmqJanus::Tools::Replaces::Handle, type: :tools, name: :replace_handle do
|
6
6
|
subject(:replace) do
|
7
7
|
# Get request JSON file
|
8
8
|
rqe = RubyRabbitmqJanus::Tools::Requests.instance.requests['test::replace']
|
9
9
|
# Open request file
|
10
|
-
|
11
|
-
options)
|
10
|
+
described_class.new(JSON.parse(File.read(rqe)), options)
|
12
11
|
end
|
13
12
|
|
14
|
-
context 'replace classic element' do
|
13
|
+
context 'when replace classic element' do
|
15
14
|
let(:opt_session) { Random.rand(123_456_789..987_654_321) }
|
16
15
|
let(:opt_handle) { Random.rand(123_456_789..987_654_321) }
|
17
16
|
let(:opt_plugin) { 'janus.plugin.echotest' }
|
@@ -32,46 +31,47 @@ describe 'RubyRabbitmqJanus::Log', type: :tools, name: :replace_handle do
|
|
32
31
|
}
|
33
32
|
end
|
34
33
|
|
35
|
-
context '
|
34
|
+
context 'with ransform request' do
|
36
35
|
it do
|
37
36
|
expect(replace.transform_request).to be_kind_of(Hash)
|
38
37
|
end
|
39
38
|
end
|
40
39
|
|
41
|
-
context '
|
40
|
+
context 'with ransform request session_id' do
|
42
41
|
include_examples 'test replace in request', 'session_id', Integer
|
43
42
|
end
|
44
43
|
|
45
|
-
context '
|
44
|
+
context 'with ransform request transaction' do
|
46
45
|
include_examples 'test replace in request nil', 'transaction'
|
47
46
|
end
|
48
47
|
|
49
|
-
context '
|
48
|
+
context 'with ransform request handle_id' do
|
50
49
|
include_examples 'test replace in request', 'handle_id', Integer
|
51
50
|
end
|
52
51
|
|
53
|
-
context '
|
52
|
+
context 'with ransform request plugin' do
|
54
53
|
include_examples 'test replace in request', 'plugin', String
|
55
54
|
end
|
56
55
|
|
57
|
-
context '
|
56
|
+
context 'with ransform request candidates' do
|
58
57
|
include_examples 'test replace in request', 'candidates', Array
|
59
58
|
end
|
60
59
|
|
61
|
-
context '
|
60
|
+
context 'with ransform request audio' do
|
62
61
|
include_examples 'test replace in request nil', 'audio'
|
63
62
|
end
|
64
63
|
|
65
|
-
context '
|
64
|
+
context 'with ransform request sdp' do
|
66
65
|
let(:key) { 'jsep' }
|
66
|
+
|
67
67
|
include_examples 'test replace in request', 'sdp', String
|
68
68
|
end
|
69
69
|
|
70
|
-
context '
|
70
|
+
context 'with ransform request debug' do
|
71
71
|
include_examples 'test replace in request nil', 'debug'
|
72
72
|
end
|
73
73
|
|
74
|
-
context '
|
74
|
+
context 'with ransform request level' do
|
75
75
|
include_examples 'test replace in request nil', 'level'
|
76
76
|
end
|
77
77
|
end
|