@@ -15,18 +15,16 @@ defmodule Membrane.Testing.Pipeline do
1515 The testing pipeline can be started in one of two modes - either with its `:default` behaviour, or by
1616 injecting a custom module behaviour. The usage of a `:default` pipeline implementation is presented below:
1717
18- ```
19- links = [
20- child(:el1, MembraneElement1) |>
21- child(:el2, MembraneElement2)
22- ...
23- ]
24- options = [
25- module: :default # :default is the default value for this parameter, so you do not need to pass it here
26- spec: links
27- ]
28- pipeline = Membrane.Testing.Pipeline.start_link_supervised!(options)
29- ```
18+ spec = [
19+ child(:el1, MembraneElement1)
20+ |> child(:el2, MembraneElement2)
21+ ...
22+ ]
23+ options = [
24+ module: :default # :default is the default value for this parameter, so you do not need to pass it here
25+ spec: spec
26+ ]
27+ pipeline = Membrane.Testing.Pipeline.start_link_supervised!(options)
3028
3129 You can also pass your custom pipeline's module as a `:module` option of
3230 the options list. Every callback of the module
@@ -35,12 +33,10 @@ defmodule Membrane.Testing.Pipeline do
3533 nor links specified in options passed to test pipeline as that would
3634 result in a failure.
3735
38- ```
39- options = [
40- module: Your.Module
41- ]
42- pipeline = Membrane.Testing.Pipeline.start_link_supervised!(options)
43- ```
36+ options = [
37+ module: Your.Module
38+ ]
39+ pipeline = Membrane.Testing.Pipeline.start_link_supervised!(options)
4440
4541 See `t:Membrane.Testing.Pipeline.options/0` for available options.
4642
@@ -59,12 +55,12 @@ defmodule Membrane.Testing.Pipeline do
5955 Firstly, we can start the pipeline providing its options as a keyword list:
6056
6157 import Membrane.ChildrenSpec
62- children = [
63- child(source, % Membrane.Testing.Source{} ) |>
64- child(:tested_element, TestedElement) |>
65- child(sink, % Membrane.Testing.Sink{} )
58+ spec = [
59+ child(: source, Membrane.Testing.Source)
60+ |> child(:tested_element, TestedElement)
61+ |> child(: sink, Membrane.Testing.Sink)
6662 ]
67- {:ok, pipeline} = Membrane.Testing.Pipeline.start_link(spec: links )
63+ {:ok, pipeline} = Membrane.Testing.Pipeline.start_link(spec: spec )
6864
6965 We can now wait till the end of the stream reaches the sink element (don't forget
7066 to import `Membrane.Testing.Assertions`):
0 commit comments