evostream-event 1.0.3.pre.91 → 2.0.0.pre.816370746

Sign up to get free protection for your applications and to get access to all the features.
Files changed (45) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +9 -2
  3. data/lib/evostream/cli/option/argument.rb +2 -0
  4. data/lib/evostream/cli/option/search.rb +2 -0
  5. data/lib/evostream/cli/runner.rb +5 -3
  6. data/lib/evostream/event/commands.rb +1 -1
  7. data/lib/evostream/event/commands/destroy.rb +1 -1
  8. data/lib/evostream/event/commands/get_stream_info.rb +1 -1
  9. data/lib/evostream/event/commands/list_streams.rb +1 -1
  10. data/lib/evostream/event/commands/push_stream.rb +1 -1
  11. data/lib/evostream/event/commands/set_log_level.rb +1 -1
  12. data/lib/evostream/event/event/events.rb +2 -2
  13. data/lib/evostream/event/event/events/in_stream_created.rb +2 -0
  14. data/lib/evostream/event/event/events/out_stream_created.rb +2 -2
  15. data/lib/evostream/event/info.rb +2 -2
  16. data/spec/evostream/{action/action_spec.rb → action_spec.rb} +11 -11
  17. data/spec/{cli → evostream/cli}/argument/command_spec.rb +2 -0
  18. data/spec/{cli → evostream/cli}/argument/config_spec.rb +2 -0
  19. data/spec/evostream/cli/argument/help_spec.rb +26 -0
  20. data/spec/{cli → evostream/cli}/argument/host_spec.rb +2 -0
  21. data/spec/{cli → evostream/cli}/argument/port_spec.rb +2 -0
  22. data/spec/{cli → evostream/cli}/argument/search_spec.rb +2 -0
  23. data/spec/{cli → evostream/cli}/argument/version_spec.rb +2 -0
  24. data/spec/evostream/commands/create_dash_spec.rb +3 -3
  25. data/spec/evostream/commands/create_hls_spec.rb +27 -27
  26. data/spec/evostream/commands/create_spec.rb +22 -22
  27. data/spec/evostream/commands/{push_stream_spec.rb → destroy_push_stream_spec.rb} +3 -3
  28. data/spec/evostream/commands/destroy_spec.rb +6 -6
  29. data/spec/evostream/commands/get_stream_info_spec.rb +4 -4
  30. data/spec/evostream/commands/{list_stream_spec.rb → list_streams_spec.rb} +2 -2
  31. data/spec/evostream/commands/set_log_level_spec.rb +3 -3
  32. data/spec/evostream/events/events_spec.rb +1 -1
  33. data/spec/evostream/events/in_stream_closed_spec.rb +82 -0
  34. data/spec/evostream/events/in_stream_created_spec.rb +75 -0
  35. data/spec/evostream/events/{request_out_stream_created_spec.rb → out_stream_created_spec.rb} +61 -67
  36. data/spec/features/push_stream_spec.rb +4 -2
  37. data/spec/features/remove_config_spec.rb +4 -2
  38. data/spec/spec_helper.rb +12 -8
  39. data/spec/support/examples_arguments.rb +5 -0
  40. data/spec/support/fake_evostream.rb +14 -18
  41. metadata +64 -83
  42. data/spec/cli/argument/help_spec.rb +0 -28
  43. data/spec/evostream/event/event_spec.rb +0 -0
  44. data/spec/evostream/events/request_in_stream_closed_spec.rb +0 -82
  45. data/spec/evostream/events/request_in_stream_created_spec.rb +0 -75
@@ -1,28 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'spec_helper'
4
-
5
- describe Evostream::CLI::Argument::Help do
6
- let(:runner) { Evostream::Runner.new }
7
- let(:out) do
8
- file = File.join(__dir__, '..', '..', '..', 'lib', 'evostream', 'cli', 'option', 'help')
9
- File.read(file)
10
- end
11
- let(:code) { 0 }
12
-
13
- context 'when short argument' do
14
- before { ARGV.push('-h') }
15
- after { ARGV.pop }
16
-
17
- include_examples 'argument exit'
18
- include_examples 'argument output'
19
- end
20
-
21
- context 'when long argument' do
22
- before { ARGV.push('-h') }
23
- after { ARGV.pop }
24
-
25
- include_examples 'argument exit'
26
- include_examples 'argument output'
27
- end
28
- end
File without changes
@@ -1,82 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'spec_helper'
4
-
5
- describe Evostream::Events::InStreamClosed, type: :request do
6
- let(:name_stream) do
7
- "#{Evostream::Service.name}#{Faker::Number.between(1, 999)}"
8
- end
9
-
10
- let(:body) do
11
- {
12
- id: Faker::Number.between(1, 999_999),
13
- payload: {
14
- PID: Faker::Number.between(1, 999_999),
15
- appName: 'evostreamms',
16
- audio: {
17
- bytesCount: Faker::Number.between(1, 999_999),
18
- codec: 'AAAC',
19
- codecNumeric: Faker::Number.between(1, 999_999),
20
- droppedBytesCount: 0,
21
- droppedPacketsCount: 0,
22
- packetsCount: Faker::Number.between(1, 999_999)
23
- },
24
- bandwidth: Faker::Number.between(1, 999_999),
25
- connectionType: 0,
26
- creationTimestamp: Faker::Number.decimal(2),
27
- customData: nil,
28
- farIp: Faker::Internet.ip_v4_address,
29
- farPort: Faker::Number.between(1, 65_536),
30
- ip: Faker::Internet.ip_v4_address,
31
- name: name_stream,
32
- nearIp: Faker::Internet.ip_v4_address,
33
- nearPort: Faker::Number.between(1, 65_536),
34
- outStreamsUniqueIds: [
35
- 4,
36
- 5
37
- ],
38
- port: Faker::Number.between(1, 65_536),
39
- processId: Faker::Number.between(1, 999),
40
- processType: 'origin',
41
- queryTimestamp: Faker::Number.decimal(3),
42
- type: 'INP',
43
- typeNumeric: Faker::Number.between(1, 999_999_999),
44
- uniqueId: 2,
45
- upTime: Faker::Number.decimal(3),
46
- userAgent: 'Lavf56.40.101',
47
- video: {
48
- bytesCount: Faker::Number.between(1, 999_999),
49
- codec: 'VH264',
50
- codecNumeric: Faker::Number.between(1, 999_999_999),
51
- droppedBytesCount: 0,
52
- droppedPacketsCount: 0,
53
- height: Faker::Number.between(1, 999),
54
- level: Faker::Number.between(1, 999),
55
- packetsCount: Faker::Number.between(1, 999),
56
- profile: Faker::Number.between(1, 999),
57
- width: Faker::Number.between(1, 999)
58
- }
59
- },
60
- processId: Faker::Number.between(1, 999_999),
61
- timestamp: Faker::Number.between(1, 999_999),
62
- type: 'inStreamClosed'
63
- }
64
- end
65
-
66
- let(:type_default) { 'inStreamClosed' }
67
-
68
- context 'payload is correct' do
69
- let(:type) { body[:type] }
70
- let(:payload) { body[:payload] }
71
-
72
- include_examples 'payload is correct'
73
- end
74
-
75
- context 'payload isn\'t correct' do
76
- let(:body) { Faker::Lorem.paragraph }
77
- let(:type) { Faker::Games::Zelda.character }
78
- let(:payload) { Faker::Games::Zelda.game }
79
-
80
- include_examples 'payload isn\'t correct'
81
- end
82
- end
@@ -1,75 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'spec_helper'
4
-
5
- describe Evostream::Events::InStreamCreated, type: :request do
6
- let(:body) do
7
- {
8
- id: Faker::Number.between(1, 999_999),
9
- payload: {
10
- PID: Faker::Number.between(1, 999_999),
11
- appName: 'evostreamms',
12
- audio: {
13
- bytesCount: Faker::Number.between(1, 999_999),
14
- codec: 'AAAC',
15
- codecNumeric: Faker::Number.between(1, 999_999),
16
- droppedBytesCount: 0,
17
- droppedPacketsCount: 0,
18
- packetsCount: Faker::Number.between(1, 999_999)
19
- },
20
- bandwidth: Faker::Number.between(1, 999_999),
21
- connectionType: 0,
22
- creationTimestamp: Faker::Number.decimal(2),
23
- customData: nil,
24
- farIp: Faker::Internet.ip_v4_address,
25
- farPort: Faker::Number.between(1, 65_536),
26
- ip: Faker::Internet.ip_v4_address,
27
- name: "#{Faker::Games::Zelda.character}_#{Faker::Number.between(1, 999)}",
28
- nearIp: Faker::Internet.ip_v4_address,
29
- nearPort: Faker::Number.between(1, 65_536),
30
- outStreamsUniqueIds: nil,
31
- port: Faker::Number.between(1, 65_536),
32
- processId: Faker::Number.between(1, 999),
33
- processType: 'origin',
34
- queryTimestamp: Faker::Number.decimal(3),
35
- type: 'INP',
36
- typeNumeric: Faker::Number.between(1, 999_999_999),
37
- uniqueId: 2,
38
- upTime: Faker::Number.decimal(3),
39
- userAgent: 'Lavf56.40.101',
40
- video: {
41
- bytesCount: Faker::Number.between(1, 999_999),
42
- codec: 'VH264',
43
- codecNumeric: Faker::Number.between(1, 999_999_999),
44
- droppedBytesCount: 0,
45
- droppedPacketsCount: 0,
46
- height: Faker::Number.between(1, 999),
47
- level: Faker::Number.between(1, 999),
48
- packetsCount: Faker::Number.between(1, 999),
49
- profile: Faker::Number.between(1, 999),
50
- width: Faker::Number.between(1, 999)
51
- }
52
- },
53
- processId: Faker::Number.between(1, 999_999),
54
- timestamp: Faker::Number.between(1, 999_999),
55
- type: 'inStreamCreated'
56
- }
57
- end
58
-
59
- let(:type_default) { 'inStreamCreated' }
60
-
61
- context 'payload is correct' do
62
- let(:type) { body[:type] }
63
- let(:payload) { body[:payload] }
64
-
65
- include_examples 'payload is correct'
66
- end
67
-
68
- context 'payload isn\'t correct' do
69
- let(:body) { Faker::Lorem.paragraph }
70
- let(:type) { Faker::Games::Zelda.character }
71
- let(:payload) { Faker::Games::Zelda.game }
72
-
73
- include_examples 'payload isn\'t correct'
74
- end
75
- end