Skip to content

Add <changed> placeholder

Compare
Choose a tag to compare
@AlexB52 AlexB52 released this 17 Oct 03:38
· 69 commits to main since this release

This releases allows the developer to use the placeholder in the retest command. Something like this: retest 'bin/rails <test> && rubocop <changed>

This command will both find the matching test, the changed file and replace the placeholders accordingly.

Retest can be used with <test> and/or <changed>

retest 'rubocop <changed>'
retest 'bin/rails test <test>'
retest 'bin/rails test <test> && rubocop <changed>'
retest 'bin/rails test <test> && rubocop <test> <changed>'

Rules

If we have a post.rb and post_test.rb files. Here are the different scenarios and rules:

A change on post.rb results in:

  • <changed> => post.rb
  • <test> => post_test.rb

A change on post_test.rb results in:

  • <changed> => post_test.rb
  • <test> => post_test.rb