exercism / elixir

Exercism exercises in Elixir.
https://exercism.org/tracks/elixir
MIT License
614 stars 397 forks source link

`secrets` has confusing tests and examples by using the same value for two different variables #1521

Closed angelikatyborska closed 6 days ago

angelikatyborska commented 3 weeks ago

This:

    test "add 3" do
      add = Secrets.secret_add(3)
      assert add.(3) === 6
    end

and this:

adder = Secrets.secret_add(2)
adder.(2)
# => 4

has driven a student to attempt solutions like this:

  def secret_add(secret) do
    fn x -> x + x end
  end
# or
  def secret_add(secret) do
    fn x -> secret + secret end
  end

We should change the examples to use different values.