Skip to content

Commit

Permalink
Add preferred style for hooks ordering
Browse files Browse the repository at this point in the history
  • Loading branch information
tejasbubane committed Jan 2, 2023
1 parent 2e4dd2b commit f349208
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -521,6 +521,36 @@ class TestMeme < Minitest::Test
end
----

=== Hooks Ordering [[hooks-ordering]]

Order hooks in the order in which they will be executed.

[source,ruby]
----
# bad
class SomethingTest < Minitest::Test
def after_teardown; end
def before_teardown; end
def setup; end
def before_setup; end
def after_setup; end
def teardown; end
end
# good
class SomethingTest < Minitest::Test
def before_setup; end
def setup; end
def after_setup; end
def before_teardown; end
def teardown; end
def after_teardown; end
end
----

== File Naming [[file-naming]]

Use a consistent naming pattern of either a `test_` prefix or a `_test` suffix for filenames of tests.
Expand Down

0 comments on commit f349208

Please sign in to comment.