moxml 0.2.0 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,30 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require "spec_helper"
4
-
5
- # DocumentBuilder is an internal class for parsing
6
- # These tests verify it correctly builds Moxml document from native documents
7
- RSpec.describe Moxml::DocumentBuilder do
8
- let(:context) { Moxml.new }
9
-
10
- describe "#build" do
11
- it "builds a Moxml document from native document" do
12
- native_doc = context.parse("<root><child>content</child></root>").native
13
- builder = described_class.new(context)
14
- doc = builder.build(native_doc)
15
-
16
- expect(doc).to be_a(Moxml::Document)
17
- expect(doc.root.name).to eq("root")
18
- end
19
- end
20
-
21
- describe "element handling" do
22
- it "handles nested elements" do
23
- native_doc = context.parse("<parent><child1/><child2/></parent>").native
24
- builder = described_class.new(context)
25
- doc = builder.build(native_doc)
26
-
27
- expect(doc.root.children.length).to eq(2)
28
- end
29
- end
30
- end