[PUP-6341] SemanticPuppet::Dependency::ModuleRelease should implement operator eql? and operator '==' Created: 2016/05/23  Updated: 2016/08/11  Resolved: 2016/05/24

Status: Closed
Project: Puppet
Component/s: None
Affects Version/s: None
Fix Version/s: PUP 4.6.0

Type: Bug Priority: Normal
Reporter: Thomas Hallgren Assignee: Unassigned
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Blocks
blocks PUP-4742 Bring semantic_puppet library into Pu... Closed
Template:
Acceptance Criteria:

That SemanticPuppet does not fail spec tests on Runyby >= 2.3.0.

Story Points: 1
Sprint: Language 2016-06-01
Release Notes: Bug Fix
Release Notes Summary: Semantic Puppet (support for semver) gem was updated with fixes for problems on Ruby >= 2.3.0.

 Description   

The SemanticPuppet::Dependency::ModuleRelease class does not implement eql? or '==' which, when using Ruby versions >= 2.3.0 means that when compared using '==', it ends up in '<=>'. That method simply assumes that its argument is a SemanticPuppet::Dependency::ModuleRelease which then fails when a release is compared to something else. Example:

mod_rel == nil

results in the following error:

undefined method `priority' for nil:NilClass
     # "./lib/semantic_puppet/dependency/module_release.rb:36:in `<=>'



 Comments   
Comment by Henrik Lindberg [ 2016/05/23 ]

When the fix is in a released new SemanticPuppet gem - the version must be bumped.

Comment by Jesse Scott [ 2016/05/24 ]

semantic_puppet-0.1.3, which includes this fix, has been released and pushed to rubygems.

Comment by Thomas Hallgren [ 2016/05/24 ]

Setting this as resolved since it's been released. Thanks Jesse Scott.

Generated at Mon Dec 16 05:08:36 PST 2019 using JIRA 7.7.1#77002-sha1:e75ca93d5574d9409c0630b81c894d9065296414.