Skip to content
This repository was archived by the owner on Oct 4, 2023. It is now read-only.
This repository was archived by the owner on Oct 4, 2023. It is now read-only.

To have or not to have a 'setup' code sample? #75

@madziaf

Description

@madziaf

A couple of days before ataru reminded us, that it is checking code samples in a file in a random order, which means, that checking the same file, it can show one or more errors in the output, depending if there was any dependency between code samples.
For example, in test/resources/test_markdown.md ais defined in upper code sample and a is used in the last code sample of the file, without defining it again. Therefore ataru exits with one error (always there) or two errors (NameError).
Possible solutions:

  1. have all the tests run in a descendimng order (critic - you loose the independency of tests, and sharing the same environment by all the code snippets can lead to unexpected behaviour)
  2. having a setup code:
    a. having it on the top of the markdown file flagged in a way, e.g.
#setup
def bla 
end

or

def bla 
end

b. in the ataru_setup.rb file, that has to be written by the user.

Another question is - do I want the setup code sample to be visible for ALL other or only chosen code samples? (and how would that be possible).

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