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

Add version method to package type for testing package version #311

Merged
merged 2 commits into from Dec 16, 2013

Conversation

Projects
None yet
2 participants
@mizzy
Owner

mizzy commented Dec 16, 2013

You can write a test for checking package version like this.

describe package('httpd') do
  its(:version) { should >= '2.2.14' }
end

@mizzy mizzy referenced this pull request Dec 16, 2013

Merged

Debian related changes #22

@vincentbernat

This comment has been minimized.

Show comment
Hide comment
@vincentbernat

vincentbernat Dec 16, 2013

Contributor

That would be very useful! However, I think there is a trap with the use of >=. For example, '2.2.5' >= '2.2.14'. But this is unrelated to the functionality (we can use this functionality with a regular expression instead or do splitting before comparison).

I would also prefer to return nil if the package is not installed.

Contributor

vincentbernat commented Dec 16, 2013

That would be very useful! However, I think there is a trap with the use of >=. For example, '2.2.5' >= '2.2.14'. But this is unrelated to the functionality (we can use this functionality with a regular expression instead or do splitting before comparison).

I would also prefer to return nil if the package is not installed.

@mizzy

This comment has been minimized.

Show comment
Hide comment
@mizzy

mizzy Dec 16, 2013

Owner

I think there is a trap with the use of >=. For example, '2.2.5' >= '2.2.14'.

Yes, I know :-) It is an example to show that you can use any matchers or operators.

I would also prefer to return nil if the package is not installed.

Sure.I will fix it soon.

Owner

mizzy commented Dec 16, 2013

I think there is a trap with the use of >=. For example, '2.2.5' >= '2.2.14'.

Yes, I know :-) It is an example to show that you can use any matchers or operators.

I would also prefer to return nil if the package is not installed.

Sure.I will fix it soon.

@mizzy

This comment has been minimized.

Show comment
Hide comment
@mizzy

mizzy Dec 16, 2013

Owner

I've fixed to return nil if the package is not installed.

Please check it.

Owner

mizzy commented Dec 16, 2013

I've fixed to return nil if the package is not installed.

Please check it.

@vincentbernat

This comment has been minimized.

Show comment
Hide comment
@vincentbernat

vincentbernat Dec 16, 2013

Contributor

It suits my need! Thanks!

Contributor

vincentbernat commented Dec 16, 2013

It suits my need! Thanks!

@mizzy

This comment has been minimized.

Show comment
Hide comment
@mizzy

mizzy Dec 16, 2013

Owner

Thanks for your checking!

Owner

mizzy commented Dec 16, 2013

Thanks for your checking!

mizzy added a commit that referenced this pull request Dec 16, 2013

Merge pull request #311 from serverspec/check-package-version
Add version method to package type for testing package version

@mizzy mizzy merged commit 149d0f4 into master Dec 16, 2013

1 check failed

default The Travis CI build failed
Details

@mizzy mizzy deleted the check-package-version branch Dec 16, 2013

@mizzy

This comment has been minimized.

Show comment
Hide comment
@mizzy

mizzy Dec 16, 2013

Owner

I've released specinfra v0.0.14 and serverspec v0.13.4.

Owner

mizzy commented Dec 16, 2013

I've released specinfra v0.0.14 and serverspec v0.13.4.

@mizzy

This comment has been minimized.

Show comment
Hide comment
@mizzy

mizzy Mar 27, 2014

Owner

Released as v1.0.0.

Owner

mizzy commented Mar 27, 2014

Released as v1.0.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment