https://github.com/ruby/power_assert
Power Assert for Ruby
https://github.com/ruby/power_assert
Keywords from Contributors
rubygems activerecord activejob mvc repl rspec feature-flag rack documentation-tool ruby-gem
Last synced: about 11 hours ago
JSON representation
Repository metadata
Power Assert for Ruby
- Host: GitHub
- URL: https://github.com/ruby/power_assert
- Owner: ruby
- License: other
- Created: 2014-05-20T14:03:16.000Z (almost 12 years ago)
- Default Branch: master
- Last Pushed: 2025-11-25T02:15:34.000Z (3 months ago)
- Last Synced: 2026-01-18T16:44:32.282Z (about 1 month ago)
- Language: Ruby
- Size: 299 KB
- Stars: 201
- Watchers: 35
- Forks: 26
- Open Issues: 7
- Releases: 38
-
Metadata Files:
- Readme: README.md
- License: COPYING
README.md
power_assert
About
Power Assert shows each value of variables and method calls in the expression.
It is useful for testing, providing which value wasn't correct when the condition is not satisfied.
Failure:
assert { 3.times.to_a.include?(3) }
| | |
| | false
| [0, 1, 2]
#<Enumerator: 3:times>
Related Projects
In general, you don't need to use this library directly.
Use following test frameworks or extensions instead.
- test-unit(>= 3.0.0)
- minitest-power_assert
- rspec-power_assert
- rspec-matchers-power_assert_matchers
- pry-power_assert
- irb-power_assert
- power_p
Requirement
- CRuby 3.1+
Configuration
To colorize output messages, add require "power_assert/colorize" to your code.
(It requires irb 1.3.1+)
Known Limitations
- Expressions must be on a single line. Splitting an assertion across multiple lines prevents any report from being generated, e.g.:
assert do
# Reported
func(foo: 0123456789, bar: "abcdefg")
end
assert do
# Not reported
func(foo: 0123456789,
bar: "abcdefg")
end
- Expressions must include at least one method call. Assertions without method calls generate no report, e.g.:
val = false
assert do
# Reported
val == true
end
assert do
# Not reported
val
end
- Return values from
method_missingorsupergenerate no report, e.g.:
class Foo
def method_missing(*)
:foo
end
end
foo = Foo.new
assert do
# Not reported
foo.foo
end
- Avoid conditional branches inside assertions. Conditional logic may prevent a report from being generated, e.g.:
condition = true
expected = false
actual = true
assert do
# This fails, but nothing is reported
condition ? expected == actual : expected == actual
end
- (CRuby 4.0+)
<Struct subclass>.newgenerates no report. Use<Struct subclass>.[]instead, e.g.:
s = Struct.new(:a)
assert do
# Not reported
s.new(0)
end
assert do
# Reported
s[0]
end
Reference
Owner metadata
- Name: The Ruby Programming Language
- Login: ruby
- Email: info@ruby-lang.org
- Kind: organization
- Description: Repositories related to the Ruby Programming language
- Website: https://www.ruby-lang.org/
- Location: Matsue, Japan
- Twitter:
- Company:
- Icon url: https://avatars.githubusercontent.com/u/210414?v=4
- Repositories: 171
- Last ynced at: 2023-04-09T03:40:20.875Z
- Profile URL: https://github.com/ruby
GitHub Events
Total
- Create event: 3
- Issues event: 1
- Release event: 3
- Watch event: 8
- Delete event: 3
- Issue comment event: 10
- Push event: 16
- Pull request review event: 2
- Pull request review comment event: 1
- Pull request event: 16
- Fork event: 1
Last Year
- Create event: 2
- Release event: 1
- Issues event: 1
- Watch event: 7
- Delete event: 3
- Issue comment event: 10
- Push event: 13
- Pull request review event: 2
- Pull request review comment event: 1
- Pull request event: 16
- Fork event: 1
Committers metadata
Last synced: 2 days ago
Total Commits: 389
Total Committers: 16
Avg Commits per committer: 24.313
Development Distribution Score (DDS): 0.09
Commits in past year: 18
Committers in past year: 3
Avg Commits per committer in past year: 6.0
Development Distribution Score (DDS) in past year: 0.222
| Name | Commits | |
|---|---|---|
| Kazuki Tsujimoto | k****i@c****t | 354 |
| Hiroshi SHIBATA | h****t@r****g | 9 |
| joker1007 | k****t@g****m | 4 |
| dependabot[bot] | 4****] | 4 |
| yui-knk | s****a@g****m | 3 |
| Nobuyoshi Nakada | n****u@r****g | 3 |
| sonots | s****s@g****m | 2 |
| Peter Goldstein | p****n@g****m | 2 |
| Yoshiyuki Kinjo | y****n@g****m | 1 |
| YUKI "Piro" Hiroshi | p****x@g****m | 1 |
| Sutou Kouhei | k****u@c****m | 1 |
| Shun MIZUKAMI | n****4@g****m | 1 |
| Kenichi Kamiya | k****1@g****m | 1 |
| Jun Aruga | j****a@r****m | 1 |
| Jeremy Evans | c****e@j****t | 1 |
| Jean Boussier | j****r@g****m | 1 |
Committer domains:
- ruby-lang.org: 2
- jeremyevans.net: 1
- redhat.com: 1
- clear-code.com: 1
- callcc.net: 1
Issue and Pull Request metadata
Last synced: about 2 months ago
Total issues: 25
Total pull requests: 47
Average time to close issues: 28 days
Average time to close pull requests: 3 days
Total issue authors: 19
Total pull request authors: 21
Average comments per issue: 2.16
Average comments per pull request: 1.09
Merged pull request: 34
Bot issues: 0
Bot pull requests: 3
Past year issues: 1
Past year pull requests: 17
Past year average time to close issues: N/A
Past year average time to close pull requests: 5 days
Past year issue authors: 1
Past year pull request authors: 6
Past year average comments per issue: 6.0
Past year average comments per pull request: 1.0
Past year merged pull request: 8
Past year bot issues: 0
Past year bot pull requests: 2
Top Issue Authors
- akicho8 (5)
- utkarsh2102 (2)
- hsbt (2)
- unak (1)
- mtasaka (1)
- kbaba1001 (1)
- graaff (1)
- piroor (1)
- sanemat (1)
- junaruga (1)
- joker1007 (1)
- voxik (1)
- altV (1)
- wwood (1)
- MSP-Greg (1)
Top Pull Request Authors
- k-tsj (7)
- nobu (5)
- hsbt (4)
- yui-knk (3)
- Earlopain (3)
- dependabot[bot] (3)
- petergoldstein (2)
- tenderlove (2)
- joker1007 (2)
- piroor (2)
- jeremyevans (2)
- casperisfine (2)
- MSP-Greg (2)
- sonots (1)
- akicho8 (1)
Top Issue Labels
Top Pull Request Labels
- dependencies (3)
- github_actions (2)
Package metadata
- Total packages: 29
-
Total downloads:
- rubygems: 150,931,255 total
- Total docker downloads: 9,584,859,750
- Total dependent packages: 29 (may contain duplicates)
- Total dependent repositories: 17,456 (may contain duplicates)
- Total versions: 148
- Total maintainers: 3
gem.coop: power_assert
Power Assert shows each value of variables and method calls in the expression. It is useful for testing, providing which value wasn't correct when the condition is not satisfied.
- Homepage: https://github.com/ruby/power_assert
- Documentation: http://www.rubydoc.info/gems/power_assert/
- Licenses: BSD-2-Clause,Ruby
- Latest release: 3.0.1 (published 4 months ago)
- Last Synced: 2026-03-01T12:02:30.095Z (3 days ago)
- Versions: 38
- Dependent Packages: 0
- Dependent Repositories: 0
- Downloads: 75,450,754 Total
- Docker Downloads: 4,792,429,875
-
Rankings:
- Dependent repos count: 0.0%
- Dependent packages count: 0.0%
- Docker downloads count: 0.002%
- Average: 0.099%
- Downloads: 0.394%
- Maintainers (2)
rubygems.org: power_assert
Power Assert shows each value of variables and method calls in the expression. It is useful for testing, providing which value wasn't correct when the condition is not satisfied.
- Homepage: https://github.com/ruby/power_assert
- Documentation: http://www.rubydoc.info/gems/power_assert/
- Licenses: BSD-2-Clause,Ruby
- Latest release: 3.0.1 (published 4 months ago)
- Last Synced: 2026-03-02T07:03:03.457Z (1 day ago)
- Versions: 38
- Dependent Packages: 21
- Dependent Repositories: 17,456
- Downloads: 75,480,501 Total
- Docker Downloads: 4,792,429,875
-
Rankings:
- Docker downloads count: 0.004%
- Dependent repos count: 0.27%
- Downloads: 0.406%
- Dependent packages count: 1.022%
- Average: 1.87%
- Stargazers count: 4.125%
- Forks count: 5.39%
- Maintainers (2)
proxy.golang.org: github.com/ruby/power_assert
- Homepage:
- Documentation: https://pkg.go.dev/github.com/ruby/power_assert#section-documentation
- Licenses: other
- Latest release: v3.0.1+incompatible (published 4 months ago)
- Last Synced: 2026-03-01T08:27:24.832Z (3 days ago)
- Versions: 38
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Stargazers count: 3.652%
- Forks count: 4.693%
- Average: 7.181%
- Dependent packages count: 9.576%
- Dependent repos count: 10.802%
alpine-v3.15: ruby-power_assert
Debug tool for Ruby that displays intermediate results of a method chain
- Homepage: https://github.com/ruby/power_assert
- Licenses: BSD-2-Clause AND Ruby
- Latest release: 1.2.0-r0 (published over 4 years ago)
- Last Synced: 2026-03-01T12:23:57.947Z (2 days ago)
- Versions: 1
- Dependent Packages: 4
- Dependent Repositories: 0
-
Rankings:
- Dependent repos count: 0.0%
- Dependent packages count: 6.546%
- Average: 8.115%
- Stargazers count: 11.301%
- Forks count: 14.612%
- Maintainers (1)
alpine-v3.18: ruby-power_assert
Debug tool for Ruby that displays intermediate results of a method chain
- Homepage: https://github.com/ruby/power_assert
- Licenses: BSD-2-Clause AND Ruby
- Latest release: 2.0.3-r0 (published almost 3 years ago)
- Last Synced: 2026-02-03T16:22:45.170Z (28 days ago)
- Versions: 1
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent repos count: 0.0%
- Dependent packages count: 0.0%
- Average: 9.426%
- Stargazers count: 16.453%
- Forks count: 21.251%
- Maintainers (1)
alpine-v3.18: ruby-power_assert-doc
Debug tool for Ruby that displays intermediate results of a method chain (ri docs)
- Homepage: https://github.com/ruby/power_assert
- Licenses: BSD-2-Clause AND Ruby
- Latest release: 2.0.3-r0 (published almost 3 years ago)
- Last Synced: 2026-02-03T16:28:27.150Z (28 days ago)
- Versions: 1
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent repos count: 0.0%
- Dependent packages count: 0.0%
- Average: 9.426%
- Stargazers count: 16.453%
- Forks count: 21.251%
- Maintainers (1)
alpine-v3.16: ruby-power_assert
Debug tool for Ruby that displays intermediate results of a method chain
- Homepage: https://github.com/ruby/power_assert
- Licenses: BSD-2-Clause AND Ruby
- Latest release: 2.0.1-r0 (published almost 4 years ago)
- Last Synced: 2026-02-02T13:55:00.711Z (29 days ago)
- Versions: 1
- Dependent Packages: 2
- Dependent Repositories: 0
-
Rankings:
- Dependent repos count: 0.0%
- Average: 10.059%
- Dependent packages count: 12.044%
- Stargazers count: 12.338%
- Forks count: 15.854%
- Maintainers (1)
alpine-v3.17: ruby-power_assert
Debug tool for Ruby that displays intermediate results of a method chain
- Homepage: https://github.com/ruby/power_assert
- Licenses: BSD-2-Clause AND Ruby
- Latest release: 2.0.2-r0 (published over 3 years ago)
- Last Synced: 2026-02-03T13:44:58.778Z (28 days ago)
- Versions: 1
- Dependent Packages: 2
- Dependent Repositories: 0
-
Rankings:
- Dependent repos count: 0.0%
- Average: 11.643%
- Dependent packages count: 12.748%
- Stargazers count: 14.926%
- Forks count: 18.895%
- Maintainers (1)
alpine-v3.15: ruby-power_assert-doc
Debug tool for Ruby that displays intermediate results of a method chain (ri docs)
- Homepage: https://github.com/ruby/power_assert
- Licenses: BSD-2-Clause AND Ruby
- Latest release: 1.2.0-r0 (published over 4 years ago)
- Last Synced: 2026-03-01T12:24:42.065Z (2 days ago)
- Versions: 1
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent repos count: 0.0%
- Stargazers count: 11.301%
- Average: 12.874%
- Forks count: 14.612%
- Dependent packages count: 25.585%
- Maintainers (1)
alpine-edge: ruby-power_assert
Debug tool for Ruby that displays intermediate results of a method chain
- Homepage: https://github.com/ruby/power_assert
- Licenses: BSD-2-Clause AND Ruby
- Latest release: 2.0.5-r0 (published 11 months ago)
- Last Synced: 2026-02-12T01:04:55.894Z (20 days ago)
- Versions: 5
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent repos count: 0.0%
- Average: 13.544%
- Dependent packages count: 14.641%
- Stargazers count: 17.697%
- Forks count: 21.838%
- Maintainers (1)
alpine-edge: ruby-power_assert-doc
Debug tool for Ruby that displays intermediate results of a method chain (ri docs)
- Homepage: https://github.com/ruby/power_assert
- Licenses: BSD-2-Clause AND Ruby
- Latest release: 2.0.5-r0 (published 11 months ago)
- Last Synced: 2026-02-12T01:04:49.304Z (20 days ago)
- Versions: 5
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent repos count: 0.0%
- Average: 13.544%
- Dependent packages count: 14.641%
- Stargazers count: 17.697%
- Forks count: 21.838%
- Maintainers (1)
alpine-v3.16: ruby-power_assert-doc
Debug tool for Ruby that displays intermediate results of a method chain (ri docs)
- Homepage: https://github.com/ruby/power_assert
- Licenses: BSD-2-Clause AND Ruby
- Latest release: 2.0.1-r0 (published almost 4 years ago)
- Last Synced: 2026-02-02T13:53:33.989Z (29 days ago)
- Versions: 1
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent repos count: 0.0%
- Stargazers count: 12.338%
- Average: 13.876%
- Forks count: 15.854%
- Dependent packages count: 27.311%
- Maintainers (1)
alpine-v3.17: ruby-power_assert-doc
Debug tool for Ruby that displays intermediate results of a method chain (ri docs)
- Homepage: https://github.com/ruby/power_assert
- Licenses: BSD-2-Clause AND Ruby
- Latest release: 2.0.2-r0 (published over 3 years ago)
- Last Synced: 2026-02-03T04:40:19.797Z (29 days ago)
- Versions: 1
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent repos count: 0.0%
- Stargazers count: 14.926%
- Average: 15.269%
- Forks count: 18.895%
- Dependent packages count: 27.254%
- Maintainers (1)
alpine-v3.19: ruby-power_assert-doc
Debug tool for Ruby that displays intermediate results of a method chain (ri docs)
- Homepage: https://github.com/ruby/power_assert
- Licenses: BSD-2-Clause AND Ruby
- Latest release: 2.0.3-r0 (published almost 3 years ago)
- Last Synced: 2026-02-02T15:25:11.021Z (29 days ago)
- Versions: 1
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent repos count: 0.0%
- Dependent packages count: 0.0%
- Average: 100%
- Maintainers (1)
alpine-v3.21: ruby-power_assert-doc
Debug tool for Ruby that displays intermediate results of a method chain (ri docs)
- Homepage: https://github.com/ruby/power_assert
- Licenses: BSD-2-Clause AND Ruby
- Latest release: 2.0.4-r0 (published over 1 year ago)
- Last Synced: 2026-02-03T04:40:29.421Z (29 days ago)
- Versions: 1
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent repos count: 0.0%
- Dependent packages count: 0.0%
- Average: 100%
- Maintainers (1)
alpine-v3.22: ruby-power_assert-doc
Debug tool for Ruby that displays intermediate results of a method chain (ri docs)
- Homepage: https://github.com/ruby/power_assert
- Licenses: BSD-2-Clause AND Ruby
- Latest release: 2.0.5-r0 (published 11 months ago)
- Last Synced: 2026-02-03T04:40:33.166Z (29 days ago)
- Versions: 1
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent repos count: 0.0%
- Dependent packages count: 0.0%
- Average: 100%
- Maintainers (1)
alpine-v3.20: ruby-power_assert
Debug tool for Ruby that displays intermediate results of a method chain
- Homepage: https://github.com/ruby/power_assert
- Licenses: BSD-2-Clause AND Ruby
- Latest release: 2.0.3-r1 (published about 2 years ago)
- Last Synced: 2026-02-03T13:22:23.580Z (28 days ago)
- Versions: 1
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent repos count: 0.0%
- Dependent packages count: 0.0%
- Average: 100%
- Maintainers (1)
debian-13: ruby-power-assert
- Homepage: https://github.com/ruby/power_assert
- Documentation: https://packages.debian.org/trixie/ruby-power-assert
- Licenses:
- Latest release: 2.0.3-1 (published 19 days ago)
- Last Synced: 2026-02-13T13:18:40.543Z (18 days ago)
- Versions: 1
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent repos count: 0.0%
- Dependent packages count: 0.0%
- Average: 100%
alpine-v3.21: ruby-power_assert
Debug tool for Ruby that displays intermediate results of a method chain
- Homepage: https://github.com/ruby/power_assert
- Licenses: BSD-2-Clause AND Ruby
- Latest release: 2.0.4-r0 (published over 1 year ago)
- Last Synced: 2026-02-03T04:40:30.847Z (29 days ago)
- Versions: 1
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent repos count: 0.0%
- Dependent packages count: 0.0%
- Average: 100%
- Maintainers (1)
alpine-v3.20: ruby-power_assert-doc
Debug tool for Ruby that displays intermediate results of a method chain (ri docs)
- Homepage: https://github.com/ruby/power_assert
- Licenses: BSD-2-Clause AND Ruby
- Latest release: 2.0.3-r1 (published about 2 years ago)
- Last Synced: 2026-02-03T13:20:36.555Z (28 days ago)
- Versions: 1
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent repos count: 0.0%
- Dependent packages count: 0.0%
- Average: 100%
- Maintainers (1)
debian-12: ruby-power-assert
- Homepage: https://github.com/ruby/power_assert
- Documentation: https://packages.debian.org/bookworm/ruby-power-assert
- Licenses:
- Latest release: 2.0.3-1 (published 19 days ago)
- Last Synced: 2026-02-12T23:37:32.528Z (19 days ago)
- Versions: 1
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
alpine-v3.22: ruby-power_assert
Debug tool for Ruby that displays intermediate results of a method chain
- Homepage: https://github.com/ruby/power_assert
- Licenses: BSD-2-Clause AND Ruby
- Latest release: 2.0.5-r0 (published 11 months ago)
- Last Synced: 2026-02-03T04:40:30.401Z (29 days ago)
- Versions: 1
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent repos count: 0.0%
- Dependent packages count: 0.0%
- Average: 100%
- Maintainers (1)
alpine-v3.19: ruby-power_assert
Debug tool for Ruby that displays intermediate results of a method chain
- Homepage: https://github.com/ruby/power_assert
- Licenses: BSD-2-Clause AND Ruby
- Latest release: 2.0.3-r0 (published almost 3 years ago)
- Last Synced: 2026-02-03T13:36:39.372Z (28 days ago)
- Versions: 1
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent repos count: 0.0%
- Dependent packages count: 0.0%
- Average: 100%
- Maintainers (1)
alpine-v3.23: ruby-power_assert
Debug tool for Ruby that displays intermediate results of a method chain
alpine-v3.23: ruby-power_assert-doc
Debug tool for Ruby that displays intermediate results of a method chain (ri docs)
Dependencies
- benchmark-ips >= 0 development
- bundler >= 0 development
- byebug >= 0 development
- irb >= 1.3.1 development
- rake >= 0 development
- simplecov >= 0 development
- test-unit >= 0 development
- actions/checkout v3 composite
- ruby/setup-ruby v1 composite
- benchmark-ips >= 0 development
- bundler >= 0 development
- byebug >= 0 development
- irb >= 1.3.1 development
- rake >= 0 development
- simplecov >= 0 development
- test-unit >= 0 development
Score: 31.1092044585546