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

'parse raises an error for unknown switches' test failure #814

Open
Apteryks opened this issue Mar 2, 2023 · 2 comments
Open

'parse raises an error for unknown switches' test failure #814

Apteryks opened this issue Mar 2, 2023 · 2 comments

Comments

@Apteryks
Copy link

Apteryks commented Mar 2, 2023

Hello,

Updating this package to 1.2.1 in GNU Guix, I see the following test failure:

starting phase `check'
......................................................................................................................................................../tmp/guix-build-ruby-thor-1.2.1.drv-0/source/spec/actions/inject_into_file_spec.rb:155: warning: setting Encoding.default_external
/tmp/guix-build-ruby-thor-1.2.1.drv-0/source/spec/actions/inject_into_file_spec.rb:159: warning: setting Encoding.default_external
......................................................................................................................................................................................................................................................................................................F..................................................................................................................................................................................................................................................................................................................................................................

Failures:

  1) Thor::Options#parse raises an error for unknown switches
     Failure/Error: expect { check_unknown! }.to raise_error(Thor::UnknownArgumentError, expected)

       expected Thor::UnknownArgumentError with "Unknown switches \"--baz\"\nDid you mean?  \"--bar\"", got #<Thor::UnknownArgumentError: Unknown switches "--baz"
       Did you mean?  "--bar"> with backtrace:
         # ./lib/thor/parser/options.rb:146:in `check_unknown!'
         # ./spec/parser/options_spec.rb:17:in `check_unknown!'
         # ./spec/parser/options_spec.rb:119:in `block (4 levels) in <top (required)>'
         # ./spec/parser/options_spec.rb:119:in `block (3 levels) in <top (required)>'
     # ./spec/parser/options_spec.rb:119:in `block (3 levels) in <top (required)>'

Finished in 0.64922 seconds (files took 0.29552 seconds to load)
801 examples, 1 failure

Failed examples:

rspec ./spec/parser/options_spec.rb:112 # Thor::Options#parse raises an error for unknown switches

Coverage report generated for RSpec to /tmp/guix-build-ruby-thor-1.2.1.drv-0/source/coverage. 2225 / 2341 LOC (95.04%) covered.
Stopped processing SimpleCov as a previous error not related to SimpleCov has been detected
error: in phase 'check': uncaught exception:
%exception #<&invoke-error program: "rspec" arguments: ("spec") exit-status: 1 term-signal: #f stop-signal: #f> 
phase `check' failed after 1.1 seconds
command "rspec" "spec" failed with status 1

The direct dependencies in use are:

Perhaps something to do with the very recent rspec version used?

Thanks!

@p8
Copy link
Member

p8 commented Aug 9, 2023

Which version of Ruby are you using?

@Apteryks
Copy link
Author

I think it was 2.7.x.

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

No branches or pull requests

2 participants