• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

dblock / ruby-enum / #18
100%
master: 100%

Build:
Build:
LAST BUILD BRANCH: dblock/coveralls-github-token
DEFAULT BRANCH: master
Ran 15 Aug 2026 01:06AM UTC
Jobs 1
Files 8
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

15 Aug 2026 01:05AM UTC coverage: 100.0%. Remained the same
#18

Pull #58

dblock
Fix NoMethodError when a subclass defines no enums of its own

Ruby::Enum's class methods (keys, values, key?, value?, key, value,
to_h, parse, each) relied directly on @_enum_hash/@_enums_by_value
instance variables, which are only set the first time define is
called. A subclass that includes Ruby::Enum only through inheritance
and never calls define itself never gets these ivars set, so calling
any of the above methods raised NoMethodError on nil.

Introduces private _enum_hash/_enums_by_value reader methods that
default to an empty hash, and uses them everywhere instead of the raw
instance variables.

Closes #49.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Pull Request #58: Fix NoMethodError on enum methods when subclass defines no enums of its own

18 of 18 new or added lines in 1 file covered. (100.0%)

152 of 152 relevant lines covered (100.0%)

6.51 hits per line

Jobs
ID Job ID Ran Files Coverage
1 #18.1 15 Aug 2026 01:06AM UTC 8
100.0
Source Files on build #18
  • Tree
  • List 8
  • Changed 1
  • Source Changed 0
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Pull Request #58
  • PR Base - master (#)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc