spec/version_mapper_spec.rb in pessimize-0.4.0 vs spec/version_mapper_spec.rb in pessimize-0.5.0

- old
+ new

@@ -22,10 +22,24 @@ subject { gems.first } its(:version) { should == '~> 2.2' } end + context "with a gem, version hash with prerelease version, and minor constraint" do + let(:gems) { [ gem('example') ] } + let(:versions) { { 'example' => '2.2.3.rc1' } } + let(:mapper) { VersionMapper.new } + + before do + mapper.call gems, versions, 'minor' + end + + subject { gems.first } + + its(:version) { should == '~> 2.2.3.rc1' } + end + context "with multiple gems, version hash and minor constraint" do let(:gems) { [ gem('example'), gem('fish', '1.3.2') ] } let(:versions) { { 'example' => '1.4.9', 'fish' => '2.3.0' } } let(:mapper) { VersionMapper.new } @@ -78,8 +92,22 @@ context "the second gem" do subject { gems[1] } its(:version) { should == '~> 2.3.0' } end + end + + context "with a gem, version hash with prerelease version, and patch constraint" do + let(:gems) { [ gem('example') ] } + let(:versions) { { 'example' => '2.2.3.rc1' } } + let(:mapper) { VersionMapper.new } + + before do + mapper.call gems, versions, 'patch' + end + + subject { gems.first } + + its(:version) { should == '~> 2.2.3.rc1' } end end end