sonic-pi

https://github.com/sonic-pi-net/sonic-pi

C++

Code. Music. Live.

Minitest::Test::LifecycleHooks#before_setup

Runs before every test, before setup. This hook is meant for
libraries to extend minitest. It is not meant to be used by
test developers.

As a simplistic example:

  module MyMinitestPlugin
    def before_setup
      super
      # ... stuff to do before setup is run
    end

    def after_setup
      # ... stuff to do after setup is run
      super
    end

    def before_teardown
      super
      # ... stuff to do before teardown is run
    end

    def after_teardown
      # ... stuff to do after teardown is run
      super
    end
  end

  class MiniTest::Test
    include MyMinitestPlugin
  end

Source | Google | Stack overflow

Edit

git clone [email protected]:sonic-pi-net/sonic-pi.git

cd sonic-pi

open app/server/ruby/vendor/minitest-5.18.1/lib/minitest/test.rb

Contribute

# Make a new branch

git checkout -b -your-name--update-docs-Minitest--Test--LifecycleHooks-before_setup-for-pr


# Commit to git

git add app/server/ruby/vendor/minitest-5.18.1/lib/minitest/test.rbgit commit -m "better docs for Minitest::Test::LifecycleHooks#before_setup"


# Open pull request

gem install hub # on a mac you can `brew install hub`

hub fork

git push <your name> -your-name--update-docs-Minitest--Test--LifecycleHooks-before_setup-for-pr

hub pull-request


# Celebrate!