{"id":13411725,"url":"https://github.com/fixrb/brutal","last_synced_at":"2025-10-17T01:01:51.993Z","repository":{"id":52312580,"uuid":"228268649","full_name":"fixrb/brutal","owner":"fixrb","description":"A code-first approach to automate the writing of unit tests.","archived":false,"fork":false,"pushed_at":"2024-05-16T18:49:20.000Z","size":1092,"stargazers_count":53,"open_issues_count":2,"forks_count":2,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-07-27T11:58:27.222Z","etag":null,"topics":["ruby","scaffold","shape","test"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fixrb.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-12-15T23:39:58.000Z","updated_at":"2023-07-19T18:03:10.000Z","dependencies_parsed_at":"2024-07-30T23:09:21.292Z","dependency_job_id":null,"html_url":"https://github.com/fixrb/brutal","commit_stats":{"total_commits":59,"total_committers":3,"mean_commits":"19.666666666666668","dds":0.0847457627118644,"last_synced_commit":"e9832d7f0e1423354e8f153bcbf3892bec911a04"},"previous_names":[],"tags_count":17,"template":false,"template_full_name":null,"purl":"pkg:github/fixrb/brutal","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fixrb%2Fbrutal","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fixrb%2Fbrutal/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fixrb%2Fbrutal/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fixrb%2Fbrutal/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fixrb","download_url":"https://codeload.github.com/fixrb/brutal/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fixrb%2Fbrutal/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271430808,"owners_count":24758378,"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","status":"online","status_checked_at":"2025-08-21T02:00:08.990Z","response_time":74,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["ruby","scaffold","shape","test"],"created_at":"2024-07-30T20:01:16.215Z","updated_at":"2025-10-17T01:01:46.926Z","avatar_url":"https://github.com/fixrb.png","language":"Ruby","readme":"# Brutal 💎🔨\n\n[![Version](https://img.shields.io/github/v/tag/fixrb/brutal?label=Version\u0026logo=github)](https://github.com/fixrb/brutal/tags)\n[![Yard documentation](https://img.shields.io/badge/Yard-documentation-blue.svg?logo=github)](https://rubydoc.info/github/fixrb/brutal/main)\n[![Ruby](https://github.com/fixrb/brutal/workflows/Ruby/badge.svg?branch=main)](https://github.com/fixrb/brutal/actions?query=workflow%3Aruby+branch%3Amain)\n[![RuboCop](https://github.com/fixrb/brutal/workflows/RuboCop/badge.svg?branch=main)](https://github.com/fixrb/brutal/actions?query=workflow%3Arubocop+branch%3Amain)\n[![License](https://img.shields.io/github/license/fixrb/brutal?label=License\u0026logo=github)](https://github.com/fixrb/brutal/raw/main/LICENSE.md)\n\n\u003e A _code-first_ approach to automate the writing of unit tests.\n\n## Intro\n\n[![I Hate Tests](https://github.com/fixrb/brutal/raw/main/img/rubyhack-2019-ruby3-what-s-missing-by-yukihiro-matsumoto.jpg)](https://www.youtube.com/embed/cmOt9HhszCI?start=1732\u0026end=1736 \"I don't like tests. It's not DRY.\")\n\n\u003e I don't like tests. It's not DRY.\n\u003e -- [Matz](https://github.com/matz)\n\n## Overview\n\nLet __Brutal__ craft for you in no time a (potentially huge) framework-less vanilla Ruby file describing the actual behavior of your code across as many context combinations as necessary.\n\nBy delegating to __Brutal__ the repetitive (and redundant) task of writing tests, you will be able to focus on your core business: the code itself.\n\n![Brutal-Driven Development](https://github.com/fixrb/brutal/raw/main/img/brutal-driven-development.jpg)\n\n## Warning\n\nThe _Brutal-Driven Development_ process does not prevent bugs from appearing in the code.\n\nA generated test suite acts as a _picture of the code's behavior_. Therefore, if the code is wrong, the picture of the code's behavior will also be wrong.\n\nThe mere fact that all expectations are true does not mean that the code behaves as it should.\n\nIt is therefore the responsibility of the developer to analyze the generated behavioral pictures to ensure that the code reacts as it is supposed to according to the contexts in which it is evaluated.\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem \"brutal\", \"\u003e= 1.6.0.beta4\", require: false\n```\n\nAnd then execute:\n\n```sh\nbundle install\n```\n\nOr install it yourself as:\n\n```sh\ngem install brutal --pre\n```\n\n## Usage\n\n### YAML manifest\n\n__Brutal__ needs configuration files in YAML format to know how to write tests.\nConfiguration file names are suffixed by `_brutal.yaml` and composed of 7 top-level sections:\n\n* `header` - Specifies a block of lines to be executed once before all examples.\n* `before` - Specifies a block of lines to be executed before each example.\n* `subject` - Specifies the template of the code to be declined across contexts.\n* `contexts` - Specifies a list of variables to populate the subject's template.\n* `actuals` - Specifies templates to challenge evaluated subjects \u0026 get results.\n* `after` - Specifies a block of lines to be executed after each example.\n* `footer` - Specifies a block of lines to be executed once after all examples.\n\n### Command line\n\nThe `brutal` command comes with several options you can use to customize Brutal's behavior.\n\nFor a full list of options, run the `brutal` command with the `--help` flag:\n\n```sh\nbrutal --help\n```\n\n```txt\nUsage: brutal [options] [files or directories]\n\n    --format=FORMAT Choose \"ruby\" (default).\n    --help          Display this help.\n    --version       Display the version.\n```\n\nAssuming that in the workspace there is a configuration file named `user_brutal.yaml`, the test suite can be generated via one of these commands:\n\n```sh\nbrutal user_brutal.yaml\n```\n\nor:\n\n```sh\nbrutal .\n```\n\nor even:\n\n```sh\nbrutal\n```\n\nThis would create a `test_user.rb` file containing the test suite.\n\nAssuming now that in the workspace there are a large number of configuration files named in the `spec/` folder, the complete test suite could be generated recursively via this command:\n\n```sh\nbrutal spec/\n```\n\nThis would create one test file per configuration file matching `./spec/**/*_brutal.yaml` in to `./spec/**/test_*.rb`.\n\n### Some examples\n\n\u003chttps://github.com/fixrb/brutal/tree/main/examples/\u003e\n\n## Rake integration example\n\nGenerated test suite files could be matched as follows:\n\n```ruby\nRake::TestTask.new do |t|\n  t.pattern = \"**/test_*.rb\"\nend\n```\n\n## Contact\n\n* Source code: https://github.com/fixrb/brutal\n\n## Versioning\n\n__Brutal__ follows [Semantic Versioning 2.0](https://semver.org/).\n\n## License\n\nThe [gem](https://rubygems.org/gems/brutal) is available as open source under the terms of the [MIT License](https://github.com/fixrb/brutal/raw/main/LICENSE.md).\n\n***\n\nThis project is sponsored by [Sashité](https://github.com/sashite/):\n\n![Sashité logo](https://github.com/fixrb/brutal/raw/main/img/sponsor/dark/en/sashite.png#gh-dark-mode-only \"Sashité\")\n![Sashité logo](https://github.com/fixrb/brutal/raw/main/img/sponsor/light/en/sashite.png#gh-light-mode-only \"Sashité\")\n","funding_links":[],"categories":["Ruby"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffixrb%2Fbrutal","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffixrb%2Fbrutal","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffixrb%2Fbrutal/lists"}