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

package resource: fix NilClass errors on arch linux #2437

Merged
merged 2 commits into from Jan 16, 2018

Conversation

jerryaldrichiii
Copy link
Contributor

This modifies .info to return {} in cases where the package manager cannot be determined. This matches the behavior of @pkgman.info.

This modifies `.info` to return `{}` in cases where the package manager
cannot be determined. This matches the behavior of `@pkgman.info`.

Signed-off-by: Jerry Aldrich <jerryaldrichiii@gmail.com>
@jerryaldrichiii jerryaldrichiii requested a review from a team as a code owner January 3, 2018 00:08
@jerryaldrichiii jerryaldrichiii self-assigned this Jan 3, 2018
@@ -139,6 +139,7 @@
# undefined
it 'verify package handling on unsupported os' do
resource = MockLoader.new(:undefined).load_resource('package', 'curl')
_(resource.info).must_be_empty
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The only downside with using must_be_empty here is that if resource.info ever had a regression introduced that returned an empty string, this would still pass.

It might be safer to say .must_equal({})

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great catch! I have updated it to match what you suggested.

Signed-off-by: Jerry Aldrich <jerryaldrichiii@gmail.com>
@adamleff adamleff changed the title Fix nil:NilClass error for package resource package resource: fix NilClass errors on arch linux Jan 8, 2018
@adamleff adamleff added the Type: Bug Feature not working as expected label Jan 8, 2018
Copy link
Contributor

@chris-rock chris-rock left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @jerryaldrichiii

@chris-rock chris-rock merged commit 7bbe99b into master Jan 16, 2018
@chris-rock chris-rock deleted the ja/fix-nil-package-manager branch January 16, 2018 22:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Feature not working as expected
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants