Sha256: 9e5d49e1ed8302050453303ecf5848824fb2d3d96b9eff55fe7d88ecf3c4432a
Contents?: true
Size: 822 Bytes
Versions: 1
Compression:
Stored size: 822 Bytes
Contents
# frozen_string_literal: true require 'spec_helper' RSpec.describe 'parsing the same tag differently in different contexts' do module SameTagSpec class Bar include HappyMapper has_one :baz, String end class Baz include HappyMapper has_one :qux, String end class Foo include HappyMapper has_one :bar, Bar has_one :baz, Baz, xpath: '.' end end let(:xml) do <<~XML <foo> <bar> <baz>Hello</baz> </bar> <baz> <qux>Hi</qux> </baz> </foo> XML end it 'parses both uses correctly if xpath limits recursion' do result = SameTagSpec::Foo.parse xml aggregate_failures do expect(result.bar.baz).to eq 'Hello' expect(result.baz.qux).to eq 'Hi' end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
nokogiri-happymapper-0.8.0 | spec/features/same_tag_different_meaning_spec.rb |