Test Your Knowledge!
Take this quiz to test what you've learned in this chapter.
Quiz on testing macros.
1
Take the following module as reference:
defmodule I18n do
use Translator
locale "hp",
flash: [
disclaimer: [
notice: "Wizards are %{adjective},
],
],
wizards: [
name: "Harry",
]
Which of the following test cases could be used for testing if notice
gives the right output?
A)
test "Wizards test" do
assert I18n.t("hp", "flash.disclaimer.notice", adjective: "amazing") ==
"Wizards are amazing!"
end
B)
test "Wizards test" do
assert I18n.t("wizards", "flash.notice", adjective: "amazing") ==
"Wizards are amazing!"
end
C)
test "Wizards test" do
assert I18n.t("hp", "flash.disclaimer", "notice", adjective: "amazing") ==
"Wizards are amazing!"
end
Question 1 of 60 attempted
Get hands-on with 1400+ tech skills courses.