feat: metadata, frontmatter, write atomicity should now be in

This commit is contained in:
2026-04-24 10:16:21 +02:00
parent 1d15de60de
commit a3f2c4a5f7
25 changed files with 479 additions and 136 deletions

View File

@@ -71,9 +71,10 @@ defmodule BDS.ScriptsTest do
assert contents =~ "entrypoint: main\n"
assert contents =~ "enabled: true\n"
assert contents =~ "version: 1\n"
assert contents =~ "created_at: #{published.created_at}\n"
assert contents =~ "updated_at: #{published.updated_at}\n"
assert contents =~ ~r/created_at: \d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z\n/
assert contents =~ ~r/updated_at: \d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z\n/
assert contents =~ "\n---\nfunction main() return 'ok' end\n"
refute File.exists?(full_path <> ".tmp")
end
test "update_script bumps version and reopens a published script when content changes", %{
@@ -144,8 +145,8 @@ defmodule BDS.ScriptsTest do
"entrypoint: main",
"enabled: true",
"version: 4",
"created_at: 301",
"updated_at: 404",
"created_at: 1970-01-01T00:00:00.301Z",
"updated_at: 1970-01-01T00:00:00.404Z",
"---",
"function main() return 'restored' end",
""