-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Implement handle_child_terminated, bump version to 1.1.2
- Loading branch information
1 parent
a9b052d
commit 0f3e838
Showing
9 changed files
with
163 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
defmodule Membrane.Integration.CallbacksTest do | ||
use ExUnit.Case, async: true | ||
|
||
import Membrane.Testing.Assertions | ||
import Membrane.ChildrenSpec | ||
|
||
alias Membrane.Testing | ||
|
||
defmodule PadlessElement do | ||
use Membrane.Endpoint | ||
end | ||
|
||
defmodule PadlessElementPipeline do | ||
use Membrane.Pipeline | ||
alias Membrane.Integration.CallbacksTest.PadlessElement | ||
|
||
@impl true | ||
def handle_child_terminated(child_name, ctx, state) do | ||
assert not is_map_key(ctx.children, child_name) | ||
{[spec: child(child_name, PadlessElement)], state} | ||
end | ||
end | ||
|
||
test "handle_child_terminated" do | ||
pipeline = Testing.Pipeline.start_link_supervised!(module: PadlessElementPipeline) | ||
|
||
Testing.Pipeline.execute_actions(pipeline, spec: child(:element, PadlessElement)) | ||
first_pid = Testing.Pipeline.get_child_pid!(pipeline, :element) | ||
refute_child_terminated(pipeline, :element, 500) | ||
|
||
Testing.Pipeline.execute_actions(pipeline, remove_children: :element) | ||
assert_child_terminated(pipeline, :element) | ||
second_pid = Testing.Pipeline.get_child_pid!(pipeline, :element) | ||
|
||
assert first_pid != second_pid | ||
|
||
Testing.Pipeline.terminate(pipeline) | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters