{"id":13878802,"url":"https://github.com/ruby/power_assert","last_synced_at":"2025-05-14T08:09:33.441Z","repository":{"id":17214511,"uuid":"19983172","full_name":"ruby/power_assert","owner":"ruby","description":"Power Assert for Ruby","archived":false,"fork":false,"pushed_at":"2025-05-05T05:20:44.000Z","size":294,"stargazers_count":193,"open_issues_count":5,"forks_count":25,"subscribers_count":36,"default_branch":"master","last_synced_at":"2025-05-10T12:01:55.385Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ruby.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"COPYING","code_of_conduct":null,"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":"2014-05-20T14:03:16.000Z","updated_at":"2025-05-07T02:09:05.000Z","dependencies_parsed_at":"2024-06-02T18:37:05.227Z","dependency_job_id":"5979a08c-c9f0-4f8e-bd11-2d682beffccc","html_url":"https://github.com/ruby/power_assert","commit_stats":{"total_commits":371,"total_committers":16,"mean_commits":23.1875,"dds":0.0835579514824798,"last_synced_commit":"447f4cccf8a91cc4fa1a05271ce7255a79fc4718"},"previous_names":[],"tags_count":36,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ruby%2Fpower_assert","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ruby%2Fpower_assert/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ruby%2Fpower_assert/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ruby%2Fpower_assert/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ruby","download_url":"https://codeload.github.com/ruby/power_assert/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253568427,"owners_count":21928901,"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-08-06T08:02:00.454Z","updated_at":"2025-05-14T08:09:33.436Z","avatar_url":"https://github.com/ruby.png","language":"Ruby","funding_links":[],"categories":["Ruby"],"sub_categories":[],"readme":"# power_assert\n## About\nPower Assert shows each value of variables and method calls in the expression.\nIt is useful for testing, providing which value wasn't correct when the condition is not satisfied.\n\n    Failure:\n       assert { 3.times.to_a.include?(3) }\n                  |     |    |\n                  |     |    false\n                  |     [0, 1, 2]\n                  #\u003cEnumerator: 3:times\u003e\n\n## Related Projects\nIn general, you don't need to use this library directly.\nUse following test frameworks or extensions instead.\n\n* [test-unit](https://github.com/test-unit/test-unit)(\u003e= 3.0.0)\n  * [Document](http://test-unit.github.io/test-unit/en/Test/Unit/Assertions.html#assert-instance_method)\n* [minitest-power_assert](https://github.com/hsbt/minitest-power_assert)\n* [rspec-power_assert](https://github.com/joker1007/rspec-power_assert)\n* [rspec-matchers-power_assert_matchers](https://github.com/kachick/rspec-matchers-power_assert_matchers)\n* [pry-power_assert](https://github.com/yui-knk/pry-power_assert)\n* [irb-power_assert](https://github.com/kachick/irb-power_assert)\n* [power_p](https://github.com/k-tsj/power_p)\n\n## Requirement\n* CRuby 2.5+\n\n## Configuration\nTo colorize output messages, add \u003ccode\u003erequire \"power_assert/colorize\"\u003c/code\u003e to your code.\n(It requires CRuby 3.0.1+ or irb 1.3.1+)\n\n## Known Limitations\n* Expressions must be put in one line. Expressions with folded long lines produce nothing report, e.g.:\n\n```ruby\nassert do\n  # reported\n  func(foo: 0123456789, bar: \"abcdefg\")\nend\n\nassert do\n  # won't be reported\n  func(foo: 0123456789,\n       bar: \"abcdefg\")\nend\n```\n\n* Expressions must have one or more method call. Expressions with no method call produce nothing report, e.g.:\n\n```ruby\nval = false\nassert do\n  # reported\n  val == true\nend\n\nassert do\n  # won't be reported\n  val\nend\n```\n\n* Returned values from accessor methods, method missing, or \"super\" produce nothing report, e.g:\n\n```ruby\nclass Foo\n  attr_accessor :val\nend\nfoo = Foo.new\nfoo.val = false\n\nassert do\n  # reported (only the value of \"foo\" and the literal \"true\")\n  foo.val == true\nend\n\nassert do\n  # won't be reported\n  foo.val\nend\n```\n\n* Expressions should not have conditional branches. Expressions with such conditional codes may produce nothing report, e.g.:\n\n```ruby\ncondition = true\nexpected = false\nactual = true\nassert do\n  # this will fail but nothing reported\n  condition ? expected == actual : expected == actual\nend\n```\n\n## Reference\n* [Power Assert in Ruby (at RubyKaigi 2014) // Speaker Deck](https://speakerdeck.com/k_tsj/power-assert-in-ruby)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fruby%2Fpower_assert","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fruby%2Fpower_assert","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fruby%2Fpower_assert/lists"}