require "spec_helper" RSpec.describe 'Lutaml macros' do let(:example_file) { fixtures_path("test.exp") } context "Array of hashes" do let(:input) do <<~TEXT = Document title Author :docfile: test.adoc :nodoc: :novalid: :no-isobib: :imagesdir: spec/assets [lutaml,#{example_file},my_context] ---- {% for schema in my_context.schemas %} == {{schema.id}} {% for entity in schema.entities %} === {{entity.id}} supertypes -> {{entity.supertypes.id}} explicit -> {{entity.explicit.first.id}} {% endfor %} {% endfor %} ---- TEXT end let(:output) do <<~TEXT #{BLANK_METANORMA_HDR} annotated_3d_model_data_quality_criteria_schema a3m_data_quality_criteria_representation

supertypes → explicit →

a3m_data_quality_criterion

supertypes → explicit → assessment_specification

a3m_data_quality_criterion_specific_applied_value

supertypes → explicit → criterion_to_assign_the_value

a3m_data_quality_target_accuracy_association

supertypes → explicit → id

a3m_detailed_report_request

supertypes → explicit → value_type_requested

a3m_summary_report_request_with_representative_value

supertypes → explicit → value_type_requested

TEXT end it "correctly renders input" do expect(xml_string_conent(metanorma_process(input))) .to(be_equivalent_to(output)) end end end