use Pleroma.DataCase
alias Mix.Tasks.Pleroma.Frontend
+ import ExUnit.CaptureIO, only: [capture_io: 1]
+
@dir "test/frontend_static_test"
setup do
%Tesla.Env{status: 200, body: File.read!("test/fixtures/tesla_mock/frontend.zip")}
end)
- Frontend.run(["install", "pleroma"])
+ capture_io(fn ->
+ Frontend.run(["install", "pleroma"])
+ end)
+
assert File.exists?(Path.join([@dir, "frontends", "pleroma", "fantasy", "test.txt"]))
end
}
})
- Frontend.run(["install", "pleroma", "--file", "test/fixtures/tesla_mock/frontend.zip"])
+ capture_io(fn ->
+ Frontend.run(["install", "pleroma", "--file", "test/fixtures/tesla_mock/frontend.zip"])
+ end)
+
assert File.exists?(Path.join([@dir, "frontends", "pleroma", "fantasy", "test.txt"]))
end
%Tesla.Env{status: 200, body: File.read!("test/fixtures/tesla_mock/frontend.zip")}
end)
- Frontend.run([
- "install",
- "unknown",
- "--ref",
- "baka",
- "--build-url",
- "http://gensokyo.2hu/madeup.zip",
- "--build-dir",
- ""
- ])
+ capture_io(fn ->
+ Frontend.run([
+ "install",
+ "unknown",
+ "--ref",
+ "baka",
+ "--build-url",
+ "http://gensokyo.2hu/madeup.zip",
+ "--build-dir",
+ ""
+ ])
+ end)
assert File.exists?(Path.join([@dir, "frontends", "unknown", "baka", "test.txt"]))
end