spec/lib/new/version_spec.rb in new-0.0.6 vs spec/lib/new/version_spec.rb in new-0.0.7
- old
+ new
@@ -5,24 +5,19 @@
end
describe New::Version do
let(:version){ VersionSpec.new }
- before do
- version.version = '1.2.3'
- end
+ describe '#bump_version' do
+ it 'should bump the major version' do
+ expect(version.bump_version('1.2.3', :major).to_s).to eq '2.0.0'
+ end
- it 'should set a version' do
- expect(version.version.to_s).to eq '1.2.3'
- end
+ it 'should bump the minor version' do
+ expect(version.bump_version('1.2.3', :minor).to_s).to eq '1.3.0'
+ end
- it 'should bump the version' do
- version.bump_version :major
- expect(version.version.to_s).to eq '2.2.3'
-
- version.bump_version :minor
- expect(version.version.to_s).to eq '2.3.3'
-
- version.bump_version :patch
- expect(version.version.to_s).to eq '2.3.4'
+ it 'should bump the patch version' do
+ expect(version.bump_version('1.2.3', :patch).to_s).to eq '1.2.4'
+ end
end
end