summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Allen <dan.j.allen@gmail.com>2022-05-04 15:01:56 -0600
committerDan Allen <dan.j.allen@gmail.com>2022-05-04 15:18:18 -0600
commit34fa6f14a674fc48d864ab0607afbfbdbc56f845 (patch)
tree3af0352d42e875cebb1ad28647c93fcdaf21acdd
parent734fa9bfef5feee080f9b07d0684e3f1ede528f8 (diff)
consolidate map/uniq when used together for assertions
-rw-r--r--spec/footnote_spec.rb6
-rw-r--r--spec/table_spec.rb4
-rw-r--r--spec/title_page_spec.rb4
3 files changed, 7 insertions, 7 deletions
diff --git a/spec/footnote_spec.rb b/spec/footnote_spec.rb
index 3d530122..d8f73079 100644
--- a/spec/footnote_spec.rb
+++ b/spec/footnote_spec.rb
@@ -20,14 +20,14 @@ describe 'Asciidoctor::PDF::Converter - Footnote' do
(expect text[2][:font_size]).to be < text[1][:font_size]
(expect text[3][:font_color]).to eql '428BCA'
# superscript group
- (expect (text.slice 2, 3).map {|it| [it[:y], it[:font_size]] }.uniq).to have_size 1
+ (expect (text.slice 2, 3).uniq {|it| [it[:y], it[:font_size]] }).to have_size 1
# footnote item
(expect (strings.slice 6, 3).join).to eql '[1] More about that thing.'
(expect text[6][:y]).to be < text[5][:y]
(expect text[6][:y]).to be < 60
(expect text[6][:page_number]).to be 1
(expect text[6][:font_size]).to be 8
- (expect (text.slice 6, 3).map {|it| [it[:y], it[:font_size]] }.uniq).to have_size 1
+ (expect (text.slice 6, 3).uniq {|it| [it[:y], it[:font_size]] }).to have_size 1
# next chapter
(expect text[9][:page_number]).to be 2
end
@@ -134,7 +134,7 @@ describe 'Asciidoctor::PDF::Converter - Footnote' do
(expect text[2][:font_size]).to be < text[1][:font_size]
(expect text[3][:font_color]).to eql '428BCA'
# superscript group
- (expect (text.slice 2, 3).map {|it| [it[:y], it[:font_size]] }.uniq).to have_size 1
+ (expect (text.slice 2, 3).uniq {|it| [it[:y], it[:font_size]] }).to have_size 1
(expect text[2][:font_size]).to be < text[1][:font_size]
# footnote item
(expect (pdf.find_text 'Section B')[0][:order]).to be < (pdf.find_text '] More about that thing.')[0][:order]
diff --git a/spec/table_spec.rb b/spec/table_spec.rb
index b8d3f708..ca89aa1d 100644
--- a/spec/table_spec.rb
+++ b/spec/table_spec.rb
@@ -2527,7 +2527,7 @@ describe 'Asciidoctor::PDF::Converter - Table' do
caption_texts = pdf.find_text 'A rather long description for this table'
(expect caption_texts).to have_size 3
- (expect caption_texts.map {|it| it[:x] }.uniq).to have_size 1
+ (expect caption_texts.uniq {|it| it[:x] }).to have_size 1
end
it 'should set caption to percentage of table width as specified by argument to fit-content function' do
@@ -2574,7 +2574,7 @@ describe 'Asciidoctor::PDF::Converter - Table' do
caption_texts = pdf.find_text font_name: 'NotoSerif-Italic'
(expect caption_texts).to have_size 3
- (expect caption_texts.map {|it| it[:x] }.uniq).to have_size 1
+ (expect caption_texts.uniq {|it| it[:x] }).to have_size 1
end
it 'should allow theme to constrain caption to fixed width' do
diff --git a/spec/title_page_spec.rb b/spec/title_page_spec.rb
index 08abad85..a0398cae 100644
--- a/spec/title_page_spec.rb
+++ b/spec/title_page_spec.rb
@@ -449,7 +449,7 @@ describe 'Asciidoctor::PDF::Converter - Title Page' do
end
(expect images_by_page[1][0].data).not_to eql images_by_page[2][0].data
- (expect images_by_page[2..-1].map {|it| it[0].data }.uniq).to have_size 1
+ (expect images_by_page[2..-1].uniq {|it| it[0].data }).to have_size 1
end
it 'should not create extra blank page when document has cover page and raster page background image' do
@@ -1046,7 +1046,7 @@ describe 'Asciidoctor::PDF::Converter - Title Page' do
(expect images).to have_size expected_num_images
end
- (expect images_by_page[2..-1].map {|it| it[0].data }.uniq).to have_size 1
+ (expect images_by_page[2..-1].uniq {|it| it[0].data }).to have_size 1
end
it 'should use title page background specified in theme resolved relative to theme dir' do