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

mvz / happymapper / 76
99%

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

pending completion
76

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'

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

405 of 411 relevant lines covered (98.54%)

295.08 hits per line

Jobs
ID Job ID Ran Files Coverage
3 76.3 (2.5) 29 Nov 2019 06:13PM UTC 0
98.54
Travis Job 76.3
Source Files on build 76
Detailed source file information is not available for this build.
  • Back to Repo
  • Travis Build #76
  • Pull Request #118
  • PR Base - master (#75)
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