test/test_chatgpt.rb in jekyll-chatgpt-translate-0.0.37 vs test/test_chatgpt.rb in jekyll-chatgpt-translate-0.0.38
- old
+ new
@@ -95,9 +95,21 @@
stub_it!
chat = GptTranslate::ChatGPT.new('fake-key', 'gpt-3.5-turbo', 'en', 'ru')
assert_equal('done!', chat.translate('This is the text to send to OpenAI'))
end
+ def test_through_small_window
+ stub_it!
+ chat = GptTranslate::ChatGPT.new('fake-key', 'gpt-3.5-turbo', 'en', 'ru')
+ assert_equal(
+ "done!\n\ndone!",
+ chat.translate(
+ "This is the first paragraph\n\nThis is second\n\nThis is third",
+ min: 1, window_length: 4
+ )
+ )
+ end
+
private
def stub_it!
stub_request(:any, 'https://api.openai.com/v1/chat/completions')
.to_return(body: '{"choices":[{"message":{"content": "done!"}}]}')