Skip to content

Don't use Module.function in tests #381

Open
@alexito4

Description

@alexito4

There are some exercises where the test look like this:

     XCTAssertEqual(0, SumOfMultiples.toLimit(1, inMultiples: [3, 5]))

this confuse the students as SumOfMultiples.toLimit looks like a static function but can also be a free function scoped into the module.
Some students have showed confusion as to why they needed to create a class for a simple exercise that needed no state.
Although knowing about free functions, static/class methods and modules is interesting, I think it's desired it should be explained at it's own pace and not as a side effect of how a test is written.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions