mirror of
https://github.com/livebook-dev/livebook.git
synced 2024-12-29 19:20:46 +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()
|
||||
def local(path) do
|
||||
new(FileSystem.Local.new(), path)
|
||||
new(Livebook.Config.local_filesystem(), path)
|
||||
end
|
||||
|
||||
@doc """
|
||||
|
|
|
@ -30,6 +30,12 @@ defmodule Livebook.FileSystem.FileTest do
|
|||
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
|
||||
test "ignores the file path if an absolute path is given" do
|
||||
file_system = FileSystem.Local.new()
|
||||
|
|
Loading…
Reference in a new issue