TBD if this is just a documentation issue, or a legitimate bug. But the docs call out ~> 2.0.3 is identical to >= 2.0.3 and < 2.1;. Assuming the ; is a typo and doesn't have some special meaning, it is expected that the following test cases pass when comparing against a version with a pre-release:
I think the docs are a bit imprecise. It's not just < 2.1 but also excludes any pre-release of 2.1. I think that makes most sense for the semantics of this operator.
TBD if this is just a documentation issue, or a legitimate bug. But the docs call out
~> 2.0.3 is identical to >= 2.0.3 and < 2.1;
. Assuming the;
is a typo and doesn't have some special meaning, it is expected that the following test cases pass when comparing against a version with a pre-release:However,
matches?("2.1.0-dev", "~> 2.0.3").should be_true
does not.So either the docs are wrong given its not identical, or this just is an actual bug that needs handled in the code.