Prefer function output over input
When learning about the behavior of a function, in general the learning experience is better when provided with the input and asked for the output.
This commit is contained in:
@@ -32,10 +32,10 @@ defmodule Strings do
|
|||||||
end
|
end
|
||||||
|
|
||||||
koan "Repetition is the mother of learning" do
|
koan "Repetition is the mother of learning" do
|
||||||
assert "StringStringString" == String.duplicate(___, 3)
|
assert String.duplicate("String", 3) == ___
|
||||||
end
|
end
|
||||||
|
|
||||||
koan "Strings can be louder when necessary" do
|
koan "Strings can be louder when necessary" do
|
||||||
assert "LISTEN" == String.upcase(___)
|
assert String.upcase("listen") == ___
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -11,8 +11,8 @@ defmodule StringTests do
|
|||||||
"incredible",
|
"incredible",
|
||||||
"banana",
|
"banana",
|
||||||
"banana",
|
"banana",
|
||||||
"String",
|
"StringStringString",
|
||||||
"listen",
|
"LISTEN",
|
||||||
]
|
]
|
||||||
|
|
||||||
test_all(Strings, answers)
|
test_all(Strings, answers)
|
||||||
|
|||||||
Reference in New Issue
Block a user