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

mvz / happymapper / 76 / 3
99%
master: 99%

Build:
DEFAULT BRANCH: master
Ran 29 Nov 2019 06:13PM UTC
Files 8
Run time 0s
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

29 Nov 2019 06:11PM UTC coverage: 98.54% (+0.003%) from 98.537%
2.5

Pull #118

travis-ci

web-flow
Adds support for nested elements named 'class'

Defining an item named 'class', as in
```
class Msg
  include HappyMapper

  has_one :'class', String
end

Msg.parse('<msg></msg>')
```
currently fails with
`lib/happymapper.rb:489:in `initialize': undefined method `attributes' for nil:NilClass (NoMethodError)`

The reason is that the .class method of the HappyMapper object is
overridden and all uses of self.class, starting with the one in
`initialize`, will fail.

The spec modification in this commit demonstrates another aspect of this
problem (when applied without the other changes) and can serve as a guard
against regression.

The fix is to add __class__ as an alias of class. Of course, if anyone ever
needs __class__ as an item, they will run into the same problem.
However, a generic solution adds a lot more complexity and needing __class__
is (much?) less likely than 'class'.
Pull Request #118: Adds support for nested elements named 'class'

405 of 411 relevant lines covered (98.54%)

295.08 hits per line

Source Files on job 76.3 (2.5)
  • Tree
  • List 0
  • Changed 4
  • Source Changed 1
  • Coverage Changed 4
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 44
  • Travis Job 76.3
  • 0367f909 on github
  • Prev Job for 2.5 on master (#75.3)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc