-
Notifications
You must be signed in to change notification settings - Fork 900
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 the RegistrationSystem spec #19806
Conversation
AwesomeSpawn::CommandResultError expects an AwesomeSpawn::CommandResult argument to `#initailize` not a string. This spec was stubbing the `LinuxAdmin::SubscriptionManager#organizations` method and raising an exception with a string instead of a CommandResult.
Some comments on commit agrare@b8e02e3 spec/models/registration_system_spec.rb
|
Checked commit agrare@b8e02e3 with ruby 2.5.5, rubocop 0.69.0, haml-lint 0.20.0, and yamllint 1.10.0 |
@@ -38,7 +38,7 @@ | |||
end | |||
|
|||
it "with invalid credentials" do | |||
expect_any_instance_of(LinuxAdmin::SubscriptionManager).to receive(:organizations).once.and_raise(LinuxAdmin::CredentialError, "Invalid username or password") | |||
expect_any_instance_of(LinuxAdmin::SubscriptionManager).to receive(:organizations).once.and_raise(LinuxAdmin::CredentialError, AwesomeSpawn::CommandResult.new("command_line", "Invalid username or password", "Invalid username or password", 1)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this output is only on stderr
Fix the RegistrationSystem spec (cherry picked from commit 2e03a3b)
Hammer backport details:
|
Fix the RegistrationSystem spec (cherry picked from commit 2e03a3b)
Ivanchuk backport details:
|
AwesomeSpawn::CommandResultError expects an AwesomeSpawn::CommandResult
argument to
#initailize
not a string.LinuxAdmin correctly passes the result to the exception: https://github.com/ManageIQ/linux_admin/blob/master/lib/linux_admin/registration_system/subscription_manager.rb#L8
This spec was stubbing the
LinuxAdmin::SubscriptionManager#organizations
method and raising anexception with a string instead of a CommandResult.
This was changed by ManageIQ/awesome_spawn#39 which was committed a while ago but only recently released.