{"id":35038061,"url":"https://github.com/fteem/minitest-metz","last_synced_at":"2026-05-20T17:37:26.765Z","repository":{"id":56883917,"uuid":"49658178","full_name":"fteem/minitest-metz","owner":"fteem","description":"Make sure your code (production and tests) obey Sandi Metz' four rules for developers.","archived":false,"fork":false,"pushed_at":"2016-01-14T19:16:11.000Z","size":13,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-03-29T17:42:42.255Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Ruby","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/fteem.png","metadata":{"files":{"readme":"README.md","changelog":null,"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-01-14T16:06:14.000Z","updated_at":"2018-02-28T17:15:27.000Z","dependencies_parsed_at":"2022-08-20T23:40:27.199Z","dependency_job_id":null,"html_url":"https://github.com/fteem/minitest-metz","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/fteem/minitest-metz","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fteem%2Fminitest-metz","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fteem%2Fminitest-metz/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fteem%2Fminitest-metz/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fteem%2Fminitest-metz/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fteem","download_url":"https://codeload.github.com/fteem/minitest-metz/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fteem%2Fminitest-metz/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33269230,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-20T15:12:43.734Z","status":"ssl_error","status_checked_at":"2026-05-20T15:12:42.300Z","response_time":356,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":"2025-12-27T08:03:59.619Z","updated_at":"2026-05-20T17:37:26.748Z","avatar_url":"https://github.com/fteem.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Minitest::Metz\n\nMinitest::Metz is a Minitest plugin that under it's hood hides the [SandiMeter](https://github.com/makaroni4/sandi_meter).\nIt allows you to easily apply Sandi Metz's [four rules for developers](https://robots.thoughtbot.com/sandi-metz-rules-for-developers)\non your tests.\n\n## Why?\n\nBecause tests are code. Especially in Minitest, where each test file is a subclass\nof `Minitest::Test`.\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'minitest-metz'\n```\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install minitest-metz\n\n## Usage\n\nThere two ways that you can use this plugin:\n\n### `--metz`\n\nYou can apply the `--metz` flag when you are running your tests. If present, the\nplugin will run the `sandi_meter` for the test that ran.\n\n### `assert_obey_metz`\n\nIf you are willing of writing tests around the four rules, you can assert on\nthem. The assertions works on basically any type of class, whether it is a test\nclass or a production class. If you want to test the test class for the four\nrules:\n\n```ruby\nclass PersonTest \u003c Minitest::Test\n  def test_sandi_four_rules\n    assert_obey_metz(self.class)\n    # Or..\n    assert_obey_metz(PersonTest)\n  end\nend\n```\n\nIf you want to test another class:\n\n```ruby\nclass PersonTest \u003c Minitest::Test\n  def test_sandi_four_rules\n    assert_obey_metz(Person)\n  end\nend\n```\n\nAlso, there's the option on asserting on a file path:\n\n```ruby\nclass PersonTest \u003c Minitest::Test\n  def test_sandi_four_rules\n    assert_obey_metz(\"lib/person/person.rb\")\n  end\nend\n```\n\nAnd, of course, you can use `refute_obey_metz`, although I have no idea why\nwould you. But anyway, it's available for use. Have fun.\n\n## Development\n\nAfter checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.\n\nTo install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/fteem/minitest-metz.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffteem%2Fminitest-metz","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffteem%2Fminitest-metz","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffteem%2Fminitest-metz/lists"}