rubygems/rubygems — pull request #350 by dekellum (2012-07-04 01:10:39+00:00)
Title: Failing test cases for requirements range expressions and prereleases

Here is an oddity, continued from #349:

Prereleases are included in `>=`, `<` requirement ranges, even when they don't have prerelease segments. But anyone specifying for example `< 1.5.0` is most certainly not expecting to use 1.5.0.beta.0 if they happen to have it installed.

Failed test output:

~~~~
1) Failure:
test_satisfied_by_range_postfix(TestGemRequirement) [./test/rubygems/test_gem_requirement.rb:387]:
[">= 1.4", "< 1.5"] should not be satisfied by 1.5.0.beta.0

2) Failure:
test_satisfied_by_range_pre_inplace(TestGemRequirement) [./test/rubygems/test_gem_requirement.rb:351]:
[">= 1.4.beta", "< 1.5"] should not be satisfied by 1.5.alpha.0

3) Failure:
test_satisfied_by_range_3_postfix(TestGemRequirement) [./test/rubygems/test_gem_requirement.rb:402]:
[">= 1.4.0", "< 1.5.0"] should not be satisfied by 1.5.0.beta.0

4) Failure:
test_satisfied_by_range_with_pre_postfix(TestGemRequirement) [./test/rubygems/test_gem_requirement.rb:420]:
[">= 1.4.0.beta", "< 1.5"] should not be satisfied by 1.5.0.alpha.0

5) Failure:
test_satisfied_by_range_inplace(TestGemRequirement) [./test/rubygems/test_gem_requirement.rb:371]:
[">= 1.4", "< 1.5"] should not be satisfied by 1.5.alpha.0
~~~~

Also, a command line example:

~~~~
% gem list bundler
*** LOCAL GEMS ***
bundler (1.2.0.pre.1, 1.1.3, 1.1.0, 1.1.rc.8)

% ruby -rubygems -e "gem( 'bundler', [ '>= 1.1', '< 1.2' ] ); require 'bundler'; puts Bundler::VERSION"
1.2.0.pre.1
~~~~

Is this all expected behavior?