Skip to content

Commit

Permalink
Merge pull request #54 from puppetlabs/typo
Browse files Browse the repository at this point in the history
Fix method name typo
  • Loading branch information
mhashizume authored Jan 7, 2025
2 parents 66f73a5 + 9f9b71c commit db06895
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/semantic_puppet/version_range.rb
Original file line number Diff line number Diff line change
Expand Up @@ -398,8 +398,8 @@ def upper_bound?

# Merge two ranges so that the result matches the intersection of all matching versions.
#
# @param range [AbastractRange] the range to intersect with
# @return [AbastractRange,nil] the intersection between the ranges
# @param range [AbstractRange] the range to intersect with
# @return [AbstractRange,nil] the intersection between the ranges
#
# @api private
def intersection(range)
Expand Down Expand Up @@ -474,7 +474,7 @@ def merge(other)
excl_end = other.exclude_end?
else
max = self.end
excl_end = exclude_end && other.exclude_end?
excl_end = exclude_end? && other.exclude_end?
end

MinMaxRange.create(excl_begin ? GtRange.new(min) : GtEqRange.new(min), excl_end ? LtRange.new(max) : LtEqRange.new(max))
Expand All @@ -499,7 +499,7 @@ def merge(other)
# Checks if this matcher accepts a prerelease with the same major, minor, patch triple as the given version. Only matchers
# where this has been explicitly stated will respond `true` to this method
#
# @return [Boolean] `true` if this matcher accepts a prerelase with the tuple from the given version
# @return [Boolean] `true` if this matcher accepts a prerelease with the tuple from the given version
def test_prerelease?(_)
false
end
Expand Down
10 changes: 10 additions & 0 deletions spec/unit/semantic_puppet/version_range_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,16 @@ def self.test_range(range_list, str, includes, excludes)
expect(range.exclude_end?).to be_nil
end
end

context 'prerelease' do
test_expressions(
[ '>=5.0.1-rc0' || '>=0.5.0' ] => {
:to_str => '>=5.0.1-rc0',
:includes => ['5.0.1-rc0', '5.0.1'], # should include 1.0.0
:excludes => ['1.0.0', '5.0.0-rc0', '5.0.2-rc0']
}
)
end
end

context 'invalid expressions' do
Expand Down

0 comments on commit db06895

Please sign in to comment.