exercism / scala

Exercism exercises in Scala.
https://exercism.org/tracks/scala
MIT License
123 stars 131 forks source link

Static method in FoodChain tests #601

Closed camilopayan closed 5 years ago

camilopayan commented 5 years ago

The tests for the FoodChain exercise appear to rely on a static recite method but after some research, it seems like static methods are not part of the Scala language. This would be fixed by instantiating the FoodChain object under test, I think.

  test("fly") {
    FoodChain.recite(1, 1) should be ("""I know an old lady who swallowed a fly.
I don't know why she swallowed the fly. Perhaps she'll die.

""")
  }
ricemery commented 5 years ago

Have you tried defining your FoodChain solution using 'Object' and not 'Class'?

camilopayan commented 5 years ago

!!! closing.