-
Notifications
You must be signed in to change notification settings - Fork 3
To have or not to have a 'setup' code sample? #75
Comments
IMHO pretending to mimic all the unit test posibilities in terms of Without further changes in usage, can we allow the user choose between:
To answer the written points:
|
The user would choose between randomized/sequencially setting the choice in |
I agree with @emig. Run in sequence or random: setup: |
hi all,
Am I understanding things right? |
Yes, I agree with this solution 😄 I would imagine those things working as follows: require 'my_fancy_lib'
def setup
# Do some nice setup that is run before every snippet
end
def teardown
# Do some cleanup that is run after every snippet
end
Ataru.configure do |c|
c.run_examples_in_sequence
end |
@moonglum good idea :) |
great, as MiniTest doesn't take config file, |
yes, a configure block will do 👍 |
Great! @madziaf If you need help with implementing the |
I like this approach too. One question for my understanding: This will make another |
yes, correct. Fine with that? |
Yes, super fine. Thanks |
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
a
is defined in upper code sample anda
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:
a. having it on the top of the markdown file flagged in a way, e.g.
or
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).
The text was updated successfully, but these errors were encountered: