mirror of
https://github.com/livebook-dev/livebook.git
synced 2024-11-14 20:04:49 +08:00
21 lines
578 B
Elixir
21 lines
578 B
Elixir
defmodule LivebookWeb.FileSystemProviderTest do
|
|
use ExUnit.Case, async: true
|
|
|
|
defmodule MyProvider do
|
|
use LivebookWeb.FileSystemProvider,
|
|
from: Path.expand("../../support/static", __DIR__)
|
|
end
|
|
|
|
test "includes regular files" do
|
|
assert %{content: content} = MyProvider.get_file(["js", "app.js"], nil)
|
|
assert content =~ ~s{console.log("Hello");}
|
|
end
|
|
|
|
test "ignores directories" do
|
|
assert nil == MyProvider.get_file(["js"], nil)
|
|
end
|
|
|
|
test "ignores non-existent files" do
|
|
assert nil == MyProvider.get_file(["nonexistent.js"], nil)
|
|
end
|
|
end
|