diff --git a/spec/html5_extended_converter.rb b/spec/html5_extended_converter.rb deleted file mode 100644 index 6fe8b8b..0000000 --- a/spec/html5_extended_converter.rb +++ /dev/null @@ -1,365 +0,0 @@ -# frozen_string_literal: true - -require 'asciidoctor/foodogsquared/converters/html5-extended' - -describe Asciidoctor::Foodogsquared::Converters::HTML5Modified do - it 'should have a more semantic paragraph output' do - input = <<~INPUT - Hello there, fanciful! - INPUT - - expected = <<~HTML -

Hello there, fanciful!

- HTML - - actual = (Asciidoctor.convert input).chomp - (expect actual).to eq expected.chomp - end - - it 'should still have a more semantic paragraph output with a title' do - input = <<~INPUT - .Whoa there! - Hello there, fanciful! - INPUT - - expected = <<~HTML -

Whoa there!Hello there, fanciful!

- HTML - - actual = (Asciidoctor.convert input).chomp - (expect actual).to eq expected.chomp - end - - it 'should have a more semantic version of the admonitions' do - input = <<~INPUT - [WARNING] - ==== - Hello there - ==== - INPUT - - expected = <<~HTML - - HTML - - actual = (Asciidoctor.convert input).chomp - (expect actual).to eq expected.chomp - end - - it 'should have a more semantic version of the admonitions even with typical Asciidoc elements' do - input = <<~INPUT - [#warning-id.big.reversed] - .A warning - [WARNING] - ==== - Hello there - ==== - INPUT - - expected = <<~HTML - - HTML - - actual = (Asciidoctor.convert input).chomp - (expect actual).to eq expected.chomp - end - - it 'should have an image block with multiple ' do - input = <<~INPUT - image::hello.png[sources="hello.avif,hello.webp"] - INPUT - - expected = <<~HTML -
- hello -
- HTML - - actual = (Asciidoctor.convert input).chomp - (expect actual).to eq expected.chomp - end - - it 'should have an image block with interactive SVG images' do - input = <<~INPUT - image::#{fixtures_file 'hello.svg'}[Interactive, opts=interactive] - INPUT - - # rubocop:disable Layout/TrailingWhitespace - expected = <<~HTML -
- -
- HTML - # rubocop:enable Layout/TrailingWhitespace - - actual = (Asciidoctor.convert input).chomp - (expect actual).to eq expected.chomp - end - - it 'should have an image block with interactive SVG images with a caption' do - input = <<~INPUT - :figure-caption!: - - .SVG file - image::#{fixtures_file 'hello.svg'}[Interactive, opts=interactive] - INPUT - - # rubocop:disable Layout/TrailingWhitespace - expected = <<~HTML -
- -
SVG file
- HTML - # rubocop:enable Layout/TrailingWhitespace - - actual = (Asciidoctor.convert input).chomp - (expect actual).to eq expected.chomp - end - - it 'should have an image block with inline SVG images' do - input = <<~INPUT - image::#{fixtures_file 'hello.svg'}[Inline, opts=inline] - INPUT - - expected = <<~HTML -
#{File.read fixtures_file('hello.svg')} -
- HTML - - actual = (Asciidoctor.convert input).chomp - (expect actual).to eq expected.chomp - end - - it 'should have an image block with inline SVG image with a caption' do - input = <<~INPUT - :figure-caption!: - - .Inline SVG file - image::#{fixtures_file 'hello.svg'}[Inline, opts=inline] - INPUT - - expected = <<~HTML -
#{File.read fixtures_file('hello.svg')}
Inline SVG file
- HTML - - actual = (Asciidoctor.convert input).chomp - (expect actual).to eq expected.chomp - end - - it 'should have an image block with multiple with caption' do - input = <<~INPUT - :figure-caption!: - - .A figure caption - image::hello.png[sources="hello.avif,hello.webp"] - INPUT - - expected = <<~HTML -
- hello -
A figure caption
- HTML - - actual = (Asciidoctor.convert input).chomp - (expect actual).to eq expected.chomp - end - - it 'should have an image block with multiple , a caption, an ID, and multiple roles' do - input = <<~INPUT - :figure-caption!: - - [#image-id.whoa.there] - .A figure caption - image::hello.png[sources="hello.avif,hello.webp"] - INPUT - - expected = <<~HTML -
- hello -
A figure caption
- HTML - - actual = (Asciidoctor.convert input).chomp - (expect actual).to eq expected.chomp - end - - it 'should have an image block with multiple , a caption, an ID, and multiple roles with some attributes' do - input = <<~INPUT - :figure-caption!: - - [#image-id.whoa.there] - .A figure caption - image::hello.png[sources="hello.avif,hello.webp", width=300, height=100] - INPUT - - expected = <<~HTML -
- hello -
A figure caption
- HTML - - actual = (Asciidoctor.convert input).chomp - (expect actual).to eq expected.chomp - end - - it 'should have a video block with multiple ' do - input = <<~INPUT - video::hello.mp4[sources="hello.mp4,hello.webm"] - INPUT - - expected = <<~HTML -
- -
- HTML - - actual = (Asciidoctor.convert input).chomp - (expect actual).to eq expected.chomp - end - - it 'should have a video block with a bunch of attributes' do - input = <<~INPUT - video::hello.mp4[opts="autoplay,loop", preload="metadata"] - INPUT - - expected = <<~HTML -
- -
- HTML - - actual = (Asciidoctor.convert input).chomp - (expect actual).to eq expected.chomp - end - - it 'should have a video block with multiple and a caption' do - input = <<~INPUT - .Making up stuff right now - video::./hello.mp4[sources="hello.mp4,hello.webm"] - INPUT - - expected = <<~HTML -
- -
Making up stuff right now
- HTML - - actual = (Asciidoctor.convert input).chomp - (expect actual).to eq expected.chomp - end - - it 'should have a video block with a caption, ID, and classes' do - input = <<~INPUT - [#video-sample.reverse] - .Making up stuff right now - video::./hello.mp4[sources="hello.mp4,hello.webm"] - INPUT - - expected = <<~HTML -
- -
Making up stuff right now
- HTML - - actual = (Asciidoctor.convert input).chomp - (expect actual).to eq expected.chomp - end - - it 'should have an audio block with multiple ' do - input = <<~INPUT - audio::hello.mp3[sources="hello.mp3,hello.webm"] - INPUT - - expected = <<~HTML -
- -
- HTML - - actual = (Asciidoctor.convert input).chomp - (expect actual).to eq expected.chomp - end - - it 'should have an audio block with multiple and a caption' do - input = <<~INPUT - .Making up stuff right now - audio::./hello.mp3[sources="hello.mp3,hello.webm"] - INPUT - - expected = <<~HTML -
- -
Making up stuff right now
- HTML - - actual = (Asciidoctor.convert input).chomp - (expect actual).to eq expected.chomp - end - - it 'should have an audio element with a caption, ID, and classes' do - input = <<~INPUT - [#audio-sample.reverse] - .Making up stuff right now - audio::./hello.mp3[sources="hello.mp3,hello.webm"] - INPUT - - expected = <<~HTML -
- -
Making up stuff right now
- HTML - - actual = (Asciidoctor.convert input).chomp - (expect actual).to eq expected.chomp - end - - it 'should have a more semantic sidebar block' do - input = <<~INPUT - **** - A sidebar is used for auxiliary bits of content. - **** - INPUT - - expected = <<~HTML - - HTML - - actual = (Asciidoctor.convert input).chomp - (expect actual).to eq expected.chomp - end - - it 'should have a more semantic sidebar block with a title' do - input = <<~INPUT - .A sidebar title - **** - A sidebar is used for auxiliary bits of content. - **** - INPUT - - expected = <<~HTML - - HTML - - actual = (Asciidoctor.convert input).chomp - (expect actual).to eq expected.chomp - end - - it 'should have a more semantic sidebar block with a title, an ID, and several roles' do - input = <<~INPUT - [#sidebar-id.several.roles] - .A sidebar title - **** - A sidebar is used for auxiliary bits of content. - **** - INPUT - - expected = <<~HTML - - HTML - - actual = (Asciidoctor.convert input).chomp - (expect actual).to eq expected.chomp - end -end diff --git a/spec/html5_modified_converter/admonition.rb b/spec/html5_modified_converter/admonition.rb new file mode 100644 index 0000000..a2fc148 --- /dev/null +++ b/spec/html5_modified_converter/admonition.rb @@ -0,0 +1,41 @@ +# frozen_string_literal: true + +require 'asciidoctor/foodogsquared/converters/html5-extended' + +describe Asciidoctor::Foodogsquared::Converters::HTML5Modified do + it 'should have a more semantic version of the admonitions' do + input = <<~INPUT + [WARNING] + ==== + Hello there + ==== + INPUT + + expected = <<~HTML + + HTML + + actual = (Asciidoctor.convert input).chomp + (expect actual).to eq expected.chomp + end + + it 'should have a more semantic version of the admonitions even with typical Asciidoc elements' do + input = <<~INPUT + [#warning-id.big.reversed] + .A warning + [WARNING] + ==== + Hello there + ==== + INPUT + + expected = <<~HTML + + HTML + + actual = (Asciidoctor.convert input).chomp + (expect actual).to eq expected.chomp + end +end diff --git a/spec/html5_modified_converter/audio.rb b/spec/html5_modified_converter/audio.rb new file mode 100644 index 0000000..0fa15b5 --- /dev/null +++ b/spec/html5_modified_converter/audio.rb @@ -0,0 +1,53 @@ +# frozen_string_literal: true + +require 'asciidoctor/foodogsquared/converters/html5-extended' + +describe Asciidoctor::Foodogsquared::Converters::HTML5Modified do + it 'should have an audio block with multiple ' do + input = <<~INPUT + audio::hello.mp3[sources="hello.mp3,hello.webm"] + INPUT + + expected = <<~HTML +
+ +
+ HTML + + actual = (Asciidoctor.convert input).chomp + (expect actual).to eq expected.chomp + end + + it 'should have an audio block with multiple and a caption' do + input = <<~INPUT + .Making up stuff right now + audio::./hello.mp3[sources="hello.mp3,hello.webm"] + INPUT + + expected = <<~HTML +
+ +
Making up stuff right now
+ HTML + + actual = (Asciidoctor.convert input).chomp + (expect actual).to eq expected.chomp + end + + it 'should have an audio element with a caption, ID, and classes' do + input = <<~INPUT + [#audio-sample.reverse] + .Making up stuff right now + audio::./hello.mp3[sources="hello.mp3,hello.webm"] + INPUT + + expected = <<~HTML +
+ +
Making up stuff right now
+ HTML + + actual = (Asciidoctor.convert input).chomp + (expect actual).to eq expected.chomp + end +end diff --git a/spec/html5_modified_converter/image.rb b/spec/html5_modified_converter/image.rb new file mode 100644 index 0000000..77d565a --- /dev/null +++ b/spec/html5_modified_converter/image.rb @@ -0,0 +1,143 @@ +# frozen_string_literal: true + +require 'asciidoctor/foodogsquared/converters/html5-extended' + +describe Asciidoctor::Foodogsquared::Converters::HTML5Modified do + it 'should have an image block with multiple ' do + input = <<~INPUT + image::hello.png[sources="hello.avif,hello.webp"] + INPUT + + expected = <<~HTML +
+ hello +
+ HTML + + actual = (Asciidoctor.convert input).chomp + (expect actual).to eq expected.chomp + end + + it 'should have an image block with interactive SVG images' do + input = <<~INPUT + image::#{fixtures_file 'hello.svg'}[Interactive, opts=interactive] + INPUT + + # rubocop:disable Layout/TrailingWhitespace + expected = <<~HTML +
+ +
+ HTML + # rubocop:enable Layout/TrailingWhitespace + + actual = (Asciidoctor.convert input).chomp + (expect actual).to eq expected.chomp + end + + it 'should have an image block with interactive SVG images with a caption' do + input = <<~INPUT + :figure-caption!: + + .SVG file + image::#{fixtures_file 'hello.svg'}[Interactive, opts=interactive] + INPUT + + # rubocop:disable Layout/TrailingWhitespace + expected = <<~HTML +
+ +
SVG file
+ HTML + # rubocop:enable Layout/TrailingWhitespace + + actual = (Asciidoctor.convert input).chomp + (expect actual).to eq expected.chomp + end + + it 'should have an image block with inline SVG images' do + input = <<~INPUT + image::#{fixtures_file 'hello.svg'}[Inline, opts=inline] + INPUT + + expected = <<~HTML +
#{File.read fixtures_file('hello.svg')} +
+ HTML + + actual = (Asciidoctor.convert input).chomp + (expect actual).to eq expected.chomp + end + + it 'should have an image block with inline SVG image with a caption' do + input = <<~INPUT + :figure-caption!: + + .Inline SVG file + image::#{fixtures_file 'hello.svg'}[Inline, opts=inline] + INPUT + + expected = <<~HTML +
#{File.read fixtures_file('hello.svg')}
Inline SVG file
+ HTML + + actual = (Asciidoctor.convert input).chomp + (expect actual).to eq expected.chomp + end + + it 'should have an image block with multiple with caption' do + input = <<~INPUT + :figure-caption!: + + .A figure caption + image::hello.png[sources="hello.avif,hello.webp"] + INPUT + + expected = <<~HTML +
+ hello +
A figure caption
+ HTML + + actual = (Asciidoctor.convert input).chomp + (expect actual).to eq expected.chomp + end + + it 'should have an image block with multiple , a caption, an ID, and multiple roles' do + input = <<~INPUT + :figure-caption!: + + [#image-id.whoa.there] + .A figure caption + image::hello.png[sources="hello.avif,hello.webp"] + INPUT + + expected = <<~HTML +
+ hello +
A figure caption
+ HTML + + actual = (Asciidoctor.convert input).chomp + (expect actual).to eq expected.chomp + end + + it 'should have an image block with multiple , a caption, an ID, and multiple roles with some attributes' do + input = <<~INPUT + :figure-caption!: + + [#image-id.whoa.there] + .A figure caption + image::hello.png[sources="hello.avif,hello.webp", width=300, height=100] + INPUT + + expected = <<~HTML +
+ hello +
A figure caption
+ HTML + + actual = (Asciidoctor.convert input).chomp + (expect actual).to eq expected.chomp + end +end diff --git a/spec/html5_modified_converter/paragraph.rb b/spec/html5_modified_converter/paragraph.rb new file mode 100644 index 0000000..31ebcaa --- /dev/null +++ b/spec/html5_modified_converter/paragraph.rb @@ -0,0 +1,32 @@ +# frozen_string_literal: true + +require 'asciidoctor/foodogsquared/converters/html5-extended' + +describe Asciidoctor::Foodogsquared::Converters::HTML5Modified do + it 'should have a more semantic paragraph output' do + input = <<~INPUT + Hello there, fanciful! + INPUT + + expected = <<~HTML +

Hello there, fanciful!

+ HTML + + actual = (Asciidoctor.convert input).chomp + (expect actual).to eq expected.chomp + end + + it 'should still have a more semantic paragraph output with a title' do + input = <<~INPUT + .Whoa there! + Hello there, fanciful! + INPUT + + expected = <<~HTML +

Whoa there!Hello there, fanciful!

+ HTML + + actual = (Asciidoctor.convert input).chomp + (expect actual).to eq expected.chomp + end +end diff --git a/spec/html5_modified_converter/sidebar.rb b/spec/html5_modified_converter/sidebar.rb new file mode 100644 index 0000000..2958079 --- /dev/null +++ b/spec/html5_modified_converter/sidebar.rb @@ -0,0 +1,53 @@ +# frozen_string_literal: true + +require 'asciidoctor/foodogsquared/converters/html5-extended' + +describe Asciidoctor::Foodogsquared::Converters::HTML5Modified do + it 'should have a more semantic sidebar block' do + input = <<~INPUT + **** + A sidebar is used for auxiliary bits of content. + **** + INPUT + + expected = <<~HTML + + HTML + + actual = (Asciidoctor.convert input).chomp + (expect actual).to eq expected.chomp + end + + it 'should have a more semantic sidebar block with a title' do + input = <<~INPUT + .A sidebar title + **** + A sidebar is used for auxiliary bits of content. + **** + INPUT + + expected = <<~HTML + + HTML + + actual = (Asciidoctor.convert input).chomp + (expect actual).to eq expected.chomp + end + + it 'should have a more semantic sidebar block with a title, an ID, and several roles' do + input = <<~INPUT + [#sidebar-id.several.roles] + .A sidebar title + **** + A sidebar is used for auxiliary bits of content. + **** + INPUT + + expected = <<~HTML + + HTML + + actual = (Asciidoctor.convert input).chomp + (expect actual).to eq expected.chomp + end +end diff --git a/spec/html5_modified_converter/video.rb b/spec/html5_modified_converter/video.rb new file mode 100644 index 0000000..c1e1806 --- /dev/null +++ b/spec/html5_modified_converter/video.rb @@ -0,0 +1,68 @@ +# frozen_string_literal: true + +require 'asciidoctor/foodogsquared/converters/html5-extended' + +describe Asciidoctor::Foodogsquared::Converters::HTML5Modified do + it 'should have a video block with multiple ' do + input = <<~INPUT + video::hello.mp4[sources="hello.mp4,hello.webm"] + INPUT + + expected = <<~HTML +
+ +
+ HTML + + actual = (Asciidoctor.convert input).chomp + (expect actual).to eq expected.chomp + end + + it 'should have a video block with a bunch of attributes' do + input = <<~INPUT + video::hello.mp4[opts="autoplay,loop", preload="metadata"] + INPUT + + expected = <<~HTML +
+ +
+ HTML + + actual = (Asciidoctor.convert input).chomp + (expect actual).to eq expected.chomp + end + + it 'should have a video block with multiple and a caption' do + input = <<~INPUT + .Making up stuff right now + video::./hello.mp4[sources="hello.mp4,hello.webm"] + INPUT + + expected = <<~HTML +
+ +
Making up stuff right now
+ HTML + + actual = (Asciidoctor.convert input).chomp + (expect actual).to eq expected.chomp + end + + it 'should have a video block with a caption, ID, and classes' do + input = <<~INPUT + [#video-sample.reverse] + .Making up stuff right now + video::./hello.mp4[sources="hello.mp4,hello.webm"] + INPUT + + expected = <<~HTML +
+ +
Making up stuff right now
+ HTML + + actual = (Asciidoctor.convert input).chomp + (expect actual).to eq expected.chomp + end +end