Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix and test for #<NoMethodError: undefined method `IOError' for #<DeepL::DocumentApi:.... when 'File already exists at output path' #7

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

jtzero
Copy link

@jtzero jtzero commented Nov 22, 2024

Test commit fails because of malformed function

Failures:

  1) DeepL::DocumentApi#translate_document raises an IOError when the output file already exists
     Failure/Error:
       expect do
         DeepL.document.translate_document(example_doc_path, output_document_path,
           source_lang, target_lang, File.basename(example_doc_path),
           {})
       end.to raise_error(IOError)

       expected IOError, got #<NoMethodError: undefined method `IOError' for #<DeepL::DocumentApi:0x00000001064b7600 @api=#<DeepL:...work_retries=5, @logger=nil>, @http_client=#<Net::HTTP api.deepl.com:443 open=false>>, @options={}>> with backtrace:
         # ./lib/deepl/document_api.rb:94:in `translate_document'
         # ./spec/integration_tests/document_api_spec.rb:43:in `block (4 levels) in <top (required)>'
         # ./spec/integration_tests/document_api_spec.rb:42:in `block (3 levels) in <top (required)>'
         # ./spec/integration_tests/integration_test_utils.rb:161:in `block (3 levels) in <top (required)>'
         # ./spec/integration_tests/integration_test_utils.rb:159:in `block (2 levels) in <top (required)>'
     # ./spec/integration_tests/document_api_spec.rb:42:in `block (3 levels) in <top (required)>'
     # ./spec/integration_tests/integration_test_utils.rb:161:in `block (3 levels) in <top (required)>'
     # ./spec/integration_tests/integration_test_utils.rb:159:in `block (2 levels) in <top (required)>'

Finished in 0.02217 seconds (files took 0.82862 seconds to load)
1 example, 1 failure

Failed examples:

rspec ./spec/integration_tests/document_api_spec.rb:35 # DeepL::DocumentApi#translate_document raises an IOError when the output file already exists

Test passes in fix commit

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant