<commit_before>require_relative 'test_helper'

code = <<-eos
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<diagram program="umlet" version="14.2">
  <zoom_level>10</zoom_level>
  <element>
    <id>UMLActor</id>
    <coordinates>
      <x>20</x>
      <y>20</y>
      <w>60</w>
      <h>120</h>
    </coordinates>
    <panel_attributes>Hello
AsciiDoc</panel_attributes>
    <additional_attributes/>
  </element>
</diagram>
eos


describe Asciidoctor::Diagram::UmletBlockMacroProcessor do
  it "should generate SVG images when format omitted" do
    File.write('umlet.uxf', code)

    doc = <<-eos
= Hello, Umlet!
Doc Writer <<EMAIL>>

== First Section

umlet::umlet.uxf[]
    eos
    
    d = load_asciidoc doc
    expect(d).to_not be_nil
  
    b = d.find { |bl| bl.context == :image }
    expect(b).to_not be_nil

    expect(b.content_model).to eq :empty

    target = b.attributes['target']
    expect(target).to_not be_nil
    expect(target).to match(/\.svg$/)
    expect(File.exist?(target)).to be true

    expect(b.attributes['width']).to_not be_nil
    expect(b.attributes['height']).to_not be_nil
  end
end


describe Asciidoctor::Diagram::UmletBlockProcessor do
  it "should generate PNG images when format is omitted" do
    doc = <<-eos
= Hello, Umlet!
Doc Writer <<EMAIL>>

== First Section

[umlet]
----
#{code}
----
    eos
    
    d = load_asciidoc doc
    expect(d).to_not be_nil
  
    b = d.find { |bl| bl.context == :image }
    expect(b).to_not be_nil

    expect(b.content_model).to eq :empty

    target = b.attributes['target']
    expect(target).to_not be_nil
    expect(target).to match(/\.svg$/)
    expect(File.exist?(target)).to be true

    expect(b.attributes['width']).to_not be_nil
    expect(b.attributes['height']).to_not be_nil
  end
end
<commit_msg>Fixed typo in spec description<commit_after>require_relative 'test_helper'

code = <<-eos
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<diagram program="umlet" version="14.2">
  <zoom_level>10</zoom_level>
  <element>
    <id>UMLActor</id>
    <coordinates>
      <x>20</x>
      <y>20</y>
      <w>60</w>
      <h>120</h>
    </coordinates>
    <panel_attributes>Hello
AsciiDoc</panel_attributes>
    <additional_attributes/>
  </element>
</diagram>
eos


describe Asciidoctor::Diagram::UmletBlockMacroProcessor do
  it "should generate SVG images when format omitted" do
    File.write('umlet.uxf', code)

    doc = <<-eos
= Hello, Umlet!
Doc Writer <<EMAIL>>

== First Section

umlet::umlet.uxf[]
    eos
    
    d = load_asciidoc doc
    expect(d).to_not be_nil
  
    b = d.find { |bl| bl.context == :image }
    expect(b).to_not be_nil

    expect(b.content_model).to eq :empty

    target = b.attributes['target']
    expect(target).to_not be_nil
    expect(target).to match(/\.svg$/)
    expect(File.exist?(target)).to be true

    expect(b.attributes['width']).to_not be_nil
    expect(b.attributes['height']).to_not be_nil
  end
end


describe Asciidoctor::Diagram::UmletBlockProcessor do
  it "should generate SVG images when format is omitted" do
    doc = <<-eos
= Hello, Umlet!
Doc Writer <<EMAIL>>

== First Section

[umlet]
----
#{code}
----
    eos
    
    d = load_asciidoc doc
    expect(d).to_not be_nil
  
    b = d.find { |bl| bl.context == :image }
    expect(b).to_not be_nil

    expect(b.content_model).to eq :empty

    target = b.attributes['target']
    expect(target).to_not be_nil
    expect(target).to match(/\.svg$/)
    expect(File.exist?(target)).to be true

    expect(b.attributes['width']).to_not be_nil
    expect(b.attributes['height']).to_not be_nil
  end
end

{'fraction_non_alphanumeric': 0.15239678581324467, 'fraction_numerical': 0.00942089221390967, 'mean_word_length': 3.2621015348288074, 'pattern_counts': {'":': 0, '<': 67, '<?xml version=': 2, '>': 55, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5856967', 'n_tokens_mistral': 1364, 'n_tokens_neox': 1320, 'n_words': 276}