{"id":22750402,"url":"https://github.com/ruby2elixir/mr_t","last_synced_at":"2025-06-19T04:36:00.530Z","repository":{"id":62429940,"uuid":"65294235","full_name":"ruby2elixir/mr_t","owner":"ruby2elixir","description":"Instant code-reloader and test runner for Elixir in one package","archived":false,"fork":false,"pushed_at":"2018-05-09T13:32:57.000Z","size":3566,"stargazers_count":26,"open_issues_count":1,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-14T13:10:20.758Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ruby2elixir.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-08-09T12:46:26.000Z","updated_at":"2023-09-01T08:50:47.000Z","dependencies_parsed_at":"2022-11-01T20:04:22.904Z","dependency_job_id":null,"html_url":"https://github.com/ruby2elixir/mr_t","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ruby2elixir/mr_t","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ruby2elixir%2Fmr_t","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ruby2elixir%2Fmr_t/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ruby2elixir%2Fmr_t/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ruby2elixir%2Fmr_t/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ruby2elixir","download_url":"https://codeload.github.com/ruby2elixir/mr_t/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ruby2elixir%2Fmr_t/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260689023,"owners_count":23046992,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-11T04:14:42.123Z","updated_at":"2025-06-19T04:35:55.151Z","avatar_url":"https://github.com/ruby2elixir.png","language":"Elixir","readme":"# MrT\n\n[![Build status](https://travis-ci.org/ruby2elixir/mr_t.svg \"Build status\")](https://travis-ci.org/ruby2elixir/mr_t)\n[![Hex version](https://img.shields.io/hexpm/v/mr_t.svg \"Hex version\")](https://hex.pm/packages/mr_t)\n![Hex downloads](https://img.shields.io/hexpm/dt/mr_t.svg \"Hex downloads\")\n\n\n\u003cimg src=\"https://raw.githubusercontent.com/ruby2elixir/mr_t/master/docs/mr-t.jpg\" alt=\"alt text\" height=\"200\"\u003e\n\nInstant code-reloader and test runner for Elixir in one package.\nCurrently tightly coupled to ExUnit and the conventional folder structure of Elixir packages.\n\n## Installation\n  1. Add `mr_t` to your list of dependencies in `mix.exs`:\n\n    ```elixir\n    def deps do\n      [{:mr_t, \"~\u003e 0.6.0\", only: [:test, :dev]}]\n    end\n    ```\n\n### Why pick this library instead of other alternatives?\n\nWell... Because of the cool name, of course!\n\n\u003e People ask me what the \"T\" stands for in my name. If you're a man, the \"T\" stands for TESTING. If you're a woman or child, it also stands for TESTING!\n\u003e\n\u003e\u003e \u003ccite\u003eMr. T\u003c/cite\u003e\n\nBack to serious...\n\nIn development mode this library allows you to iterate really quickly on your code, in similar fashion like the the Clojure REPL does. You can type in the editor and see the effect directly in IEx, without explicit \"recompile\" call. That feels a bit like magic... Good magic! On syntax errors you'll get the backtrace, but besides the library stays out of your way. And you have to start it explictly, just in case you don't want magic code reloading in the IEx.\n\nIn test mode it executes test code directly in current IEx, so you dont have to run a separate Mix process in the background. That keeps the feedback loop really tight, especially for large projects.\n\nSkip loading all the code / tests again and again for every test run, you will feel the difference quite quickly. Also I'd like to have a concept of `RunStrategies`, that is a flexible way to match a changed file to corresponding test files.\n\nRight now there is only a very simple RootName strategy, that turns a file like \"lib/logic/email_sender.ex\" to \"email_sender\" and runs all test files with that string in the full paths, like:\n\n    - tests/email_sender_test.exs\n    - tests/email_sender/mandrill_adapter_test.exs\n\nThis simple strategy allows you to run just the relevant tests quickly on each save-file stroke, directly in the IEx. It works also with Phoenix controllers / models quite nicely. Because we're keeping the Erlang VM running, the feedback for our TDD cycle is exceptionally fast.\n\n### Demo: MrT Dev mode\n\u003cimg src=\"https://raw.githubusercontent.com/ruby2elixir/mr_t/master/docs/mrt_dev_mode.gif\" alt=\"Demo\" height=\"300\"\u003e\n\n- Installation\n- Starting MrT\n- Code reloading in dev mode\n- Feedback on syntax errors\n- Reloading continues to work after syntax errors fixed\n\n\u003cbr /\u003e\n\u003cbr /\u003e\n\u003cbr /\u003e\n\n### Demo: MrT Test mode\n\u003cimg src=\"https://raw.githubusercontent.com/ruby2elixir/mr_t/master/docs/mrt_test_mode.gif\" alt=\"Demo\" height=\"300\"\u003e\n\n- TDD cycle\n- Starting MrT\n- Code reloading in test mode\n- Changes to code without matching tests files\n- Changes to code where only the relevant tests files are executed\n\n\u003cbr /\u003e\n\u003cbr /\u003e\n\u003cbr /\u003e\n\n\n## Code Reloader\n    $ iex -S mix\n    # this starts only the code reloading, because we are in the :dev environment\n    iex\u003e MrT.start\n    # now write some code in the editor, it will be immediately available in the IEx console\n\n\n## Testrunner\n    $ MIX_ENV=test iex -S mix\n    # this starts test runner and  code reloading, because we are in the :test environment\n    iex\u003e MrT.start\n    # now code / write unit tests\n\n    ## for more manual control:\n    # run tests only with \"user\" in filename\n    iex\u003e MrT.run_matching(\"user\")\n    # run all tests\n    iex\u003e MrT.run_all\n\n    # run only tests with tag :focus in matched files\n    iex\u003e MrT.focus(:focus)\n\n    # can be combined with RunAll strategy to run focused tests in all test files\n    iex\u003e MrT.run_all_strategy_on\n\n\n    ### when finished with focused test, reset and turn back to RootName strategy\n    # run only files matching basename\n    iex\u003e MrT.run_all_strategy_off\n    # reverse / reset  ExUnit focus\n    iex\u003e MrT.unfocus\n\n\n    ### debugging with verbose mode\n    iex\u003e MrT.verbosity_on\n    iex\u003e MrT.verbosity_off\n\n\n### Stopping\n    iex\u003e MrT.stop\n\n### Alternatives:\n  - [ExSync](https://github.com/falood/exsync/)\n  - [mix test.watch](https://github.com/lpil/mix-test.watch/)\n  - [EyeDrops](https://github.com/rkotze/eye_drops)\n\n### Desktop Notifications\n  - [ex_unit_notifier - Desktop notifications for ExUnit](https://github.com/navinpeiris/ex_unit_notifier) (recommended)\n  - [mix_test_notify - OSX notifications for mix test](https://github.com/apdunston/mix_test_notify)\n\n### TODO\n    [x] remove most of the reloading logic, because now the recompilation happens with IEx.Helpers\n    [x] allow stopping MrT\n    [x] make configuration more flexible\n    [x] configurable verbosity (default is silent)\n    [x] allow adding ExUnit contraints (tags)\n    [ ] Add MrT.Doctor for self-diagnosis\n    [ ] handle fs events properly (deletion / tmp files)\n    [ ] allow multiple ordered run_strategies\n    [ ] write unit tests\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fruby2elixir%2Fmr_t","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fruby2elixir%2Fmr_t","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fruby2elixir%2Fmr_t/lists"}