From 09a93481f01d2a54377323760e455e8351371a8b Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Fri, 24 Nov 2023 11:42:33 +0800 Subject: [PATCH] Add basic Asciidoc conversion with API test for chat block --- spec/chat_block_processor_spec.rb | 32 +++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/spec/chat_block_processor_spec.rb b/spec/chat_block_processor_spec.rb index 3843e98..4bae7fe 100644 --- a/spec/chat_block_processor_spec.rb +++ b/spec/chat_block_processor_spec.rb @@ -89,4 +89,36 @@ describe ChatBlock do actual = (Asciidoctor.convert input).tr_s '\n', '\n' (expect actual).to include expected.chomp end + + it 'should create a basic chat block with non-default values from the document' do + input = <<~INPUT + [chat, foodogsquared, state=nervous, role=shake] + ==== + Hello there! + + *wow* + ==== + INPUT + + expected = <<~RESULT +
+
+ foodogsquared +
+
+ foodogsquared +
+

Hello there!

+
+
+

wow

+
+
+
+ RESULT + + attributes = { 'avatarstype' => 'hello', 'avatarsdir' => '/avatars' } + actual = (Asciidoctor.convert input, attributes: attributes).tr_s '\n', '\n' + (expect actual).to include expected.chomp + end end