Skip to content

The "Writing explicit tests for SQL kata" sample test suite does not compile #517

Open
@interrupt-routine

Description

@interrupt-routine

URL: https://docs.codewars.com/languages/sql/explicit-tests

The code will fail to compile when tried in a kumite:

./spec/support/preloaded.rb:6:in `show_diff_table': uninitialized constant DaffWrapper (NameError)

After taking a look at https://github.com/codewars/sql_spec_helper/blob/main/lib/sql_spec_helper/daff_wrapper.rb , I came up with a hotfix for the issue: DaffWrapper needs to be qualified, since it's an inner class (no idea why it once compiled, perhaps because the preloaded SQL section used to be concatenated to the tests but is now in its separate file).

qualifying DaffWrapper --> SqlSpecHelper::DaffWrapper makes the code compile.

(Though the whole tutorial is probably a bit outdated. Also, maybe it would be good to at least provide a link to the https://github.com/codewars/sql_spec_helper/tree/main repository in the https://docs.codewars.com/languages/sql/rspec doc page that's currently entirely empty).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions