We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a930ea2 commit 4e459b0Copy full SHA for 4e459b0
spec/docx/document_spec.rb
@@ -504,4 +504,22 @@
504
expect(doc.to_s).to be_a(String)
505
end
506
507
+
508
+ describe 'reading style' do
509
+ before do
510
+ @doc = Docx::Document.open(@fixtures_path + '/test_with_style.docx')
511
+ end
512
513
+ it 'read default style when not' do
514
+ nb = @doc.paragraphs.size
515
+ expect(nb).to eq 6
516
+ expect(@doc.paragraphs[0].style).to eq 'Normal'
517
+ expect(@doc.paragraphs[1].style).to eq 'STYLE1'
518
+ expect(@doc.paragraphs[2].style).to eq 'heading 1'
519
+ expect(@doc.paragraphs[3].style).to eq 'Normal'
520
+ expect(@doc.paragraphs[4].style).to eq 'Normal'
521
+ expect(@doc.paragraphs[5].style).to eq 'STYLE1'
522
523
524
525
spec/fixtures/test_with_style.docx
20.7 KB
0 commit comments