mirror of
https://github.com/livebook-dev/livebook.git
synced 2025-01-01 12:41:43 +08:00
Use the same local file system instance for all files (#1070)
* Use the same local file system instance for all files * Add test
This commit is contained in:
parent
1fab2f54bf
commit
894ff15419
2 changed files with 7 additions and 1 deletions
|
@ -49,7 +49,7 @@ defmodule Livebook.FileSystem.File do
|
||||||
"""
|
"""
|
||||||
@spec local(FileSystem.path()) :: t()
|
@spec local(FileSystem.path()) :: t()
|
||||||
def local(path) do
|
def local(path) do
|
||||||
new(FileSystem.Local.new(), path)
|
new(Livebook.Config.local_filesystem(), path)
|
||||||
end
|
end
|
||||||
|
|
||||||
@doc """
|
@doc """
|
||||||
|
|
|
@ -30,6 +30,12 @@ defmodule Livebook.FileSystem.FileTest do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
describe "local/1" do
|
||||||
|
test "uses the globally configured local file system instance" do
|
||||||
|
assert FileSystem.File.local("/path").file_system == Livebook.Config.local_filesystem()
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
describe "relative/2" do
|
describe "relative/2" do
|
||||||
test "ignores the file path if an absolute path is given" do
|
test "ignores the file path if an absolute path is given" do
|
||||||
file_system = FileSystem.Local.new()
|
file_system = FileSystem.Local.new()
|
||||||
|
|
Loading…
Reference in a new issue