Skip to content

Commit 09e9cd9

Browse files
committed
test(bundle): Add test for file loader
1 parent 9c4f80a commit 09e9cd9

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

spec/fluent_spec.lua

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,12 @@ describe('fluent.bundle', function ()
1616
assert.same(locale, bundle.locale)
1717
end)
1818

19+
it('should parse and format messages loaded from a file', function ()
20+
local bundle = FluentBundle("en")
21+
bundle:load_file("spec/spec.ftl")
22+
assert.same("bar", bundle:format("foo"))
23+
end)
24+
1925
it('should parse and format single simple messages', function ()
2026
local bundle = FluentBundle("en")
2127
bundle:add_messages("foo = bar")

spec/spec.ftl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
foo = bar

0 commit comments

Comments
 (0)