Sha256: 82888a80d59ac610971901f2200ad99264993d42440d2d61f636244ac68a1b09

Contents?: true

Size: 1.12 KB

Versions: 18

Compression:

Stored size: 1.12 KB

Contents

# frozen_string_literal: true

require "spec_helper"

RSpec.describe Lutaml::Uml::Formatter::Graphviz do
  describe ".format_document" do
    subject(:format_document) do
      described_class.new.format_document(input_document)
    end

    context "when simple aggregation" do
      let(:input_document) do
        Lutaml::Uml::Parsers::Yaml
          .parse(fixtures_path("datamodel/views/AddressProfile.yml"))
      end

      let(:formatted_dot_content) do
        File.read(fixtures_path("generated_dot/AddressProfile.dot"))
      end

      it "generates the correct relationship graph" do
        expect(format_document).to eq(formatted_dot_content)
      end
    end

    context "when aggregation with inheritance" do
      let(:input_document) do
        Lutaml::Uml::Parsers::Yaml
          .parse(fixtures_path("datamodel/views/AddressClassProfile.yml"))
      end

      let(:formatted_dot_content) do
        File.read(fixtures_path("generated_dot/AddressClassProfile.dot"))
      end

      it "generates the correct relationship graph" do
        expect(format_document).to eq(formatted_dot_content)
      end
    end
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
lutaml-uml-0.4.3 spec/lutaml/uml/formatter/graphviz_spec.rb
lutaml-uml-0.4.1 spec/lutaml/uml/formatter/graphviz_spec.rb
lutaml-uml-0.4.0 spec/lutaml/uml/formatter/graphviz_spec.rb
lutaml-uml-0.3.2 spec/lutaml/uml/formatter/graphviz_spec.rb
lutaml-uml-0.3.1 spec/lutaml/uml/formatter/graphviz_spec.rb
lutaml-uml-0.3.0 spec/lutaml/uml/formatter/graphviz_spec.rb
lutaml-uml-0.2.12 spec/lutaml/uml/formatter/graphviz_spec.rb
lutaml-uml-0.2.10 spec/lutaml/uml/formatter/graphviz_spec.rb
lutaml-uml-0.2.9 spec/lutaml/uml/formatter/graphviz_spec.rb
lutaml-uml-0.2.8 spec/lutaml/uml/formatter/graphviz_spec.rb
lutaml-uml-0.2.7 spec/lutaml/uml/formatter/graphviz_spec.rb
lutaml-uml-0.2.6 spec/lutaml/uml/formatter/graphviz_spec.rb
lutaml-uml-0.2.5 spec/lutaml/uml/formatter/graphviz_spec.rb
lutaml-uml-0.2.4 spec/lutaml/uml/formatter/graphviz_spec.rb
lutaml-uml-0.2.3 spec/lutaml/uml/formatter/graphviz_spec.rb
lutaml-uml-0.2.2 spec/lutaml/uml/formatter/graphviz_spec.rb
lutaml-uml-0.2.1 spec/lutaml/uml/formatter/graphviz_spec.rb
lutaml-uml-0.2.0 spec/lutaml/uml/formatter/graphviz_spec.rb