@@ -319,7 +319,7 @@ describe GitVersion do
319
319
tmp.exec %( git merge myfeature)
320
320
321
321
tmp.exec %( git checkout master)
322
- tmp.exec %( git rebase dev)
322
+ tmp.exec %( git rebase --no-gpg-sign dev)
323
323
version = git.get_version
324
324
version.should eq(" 1.0.1" )
325
325
ensure
@@ -345,7 +345,7 @@ describe GitVersion do
345
345
346
346
tmp.exec %( git checkout dev)
347
347
tmp.exec %( git commit --no-gpg-sign --allow-empty -m "4")
348
- tmp.exec %( git rebase master)
348
+ tmp.exec %( git rebase --no-gpg-sign master)
349
349
350
350
tmp.exec %( git checkout master)
351
351
tmp.exec %( git merge --no-gpg-sign --no-ff dev)
@@ -443,7 +443,9 @@ describe GitVersion do
443
443
tmp.exec %( git init)
444
444
tmp.exec %( git checkout -b master)
445
445
tmp.exec %( git commit --no-gpg-sign --allow-empty -m "1")
446
- tmp.exec %( git tag "0.1.0-asd")
446
+ tmp.exec %( git tag "0.1.0")
447
+ tmp.exec %( git commit --no-gpg-sign --allow-empty -m "feature: 2")
448
+ tmp.exec %( git tag "0.2.0-asd")
447
449
tmp.exec %( git commit --no-gpg-sign --allow-empty -m ":breaking: 2")
448
450
449
451
version = git.get_version
@@ -484,7 +486,7 @@ describe GitVersion do
484
486
485
487
version = git.get_version
486
488
hash = git.current_commit_hash
487
- version.should eq(" 1.0.0-v1.0 .#{ hash } " )
489
+ version.should eq(" 1.0.0-v1.1 .#{ hash } " )
488
490
ensure
489
491
tmp.cleanup
490
492
end
@@ -498,11 +500,12 @@ describe GitVersion do
498
500
499
501
tmp.exec %( git init)
500
502
tmp.exec %( git checkout -b master)
501
- tmp.exec %( git commit --no-gpg-sign --allow-empty -m "1")
502
- tmp.exec %( git tag "v1.0.0")
503
+ tmp.exec %( git commit --no-gpg-sign --allow-empty -m "feature: 1")
504
+ tmp.exec %( git tag "v1.1.0")
505
+ tmp.exec %( git commit --no-gpg-sign --allow-empty -m "2")
503
506
504
507
version = git.get_version
505
- version.should eq(" v1.0 .1" )
508
+ version.should eq(" v1.1 .1" )
506
509
ensure
507
510
tmp.cleanup
508
511
end
@@ -559,7 +562,7 @@ describe GitVersion do
559
562
560
563
version = git.get_version
561
564
hash = git.current_commit_hash
562
- version.should eq(" 1.0.0-v1.0 .#{ hash } " )
565
+ version.should eq(" 1.0.0-v1.3 .#{ hash } " )
563
566
ensure
564
567
tmp.cleanup
565
568
end
@@ -703,6 +706,7 @@ describe GitVersion do
703
706
704
707
tmp.exec %( git init)
705
708
tmp.exec %( git checkout -b master)
709
+
706
710
# Create dir1 and tag dir1-1.0.0
707
711
base_dir = " dir1"
708
712
tmp.exec %( mkdir #{ base_dir } && touch #{ base_dir } /dummy_file)
@@ -718,16 +722,17 @@ describe GitVersion do
718
722
tmp.exec %( git tag "dir2-1.0.0")
719
723
720
724
tmp.exec %( git checkout -b dev)
725
+
721
726
# Create dir2 and commit breaking
722
727
base_dir = " dir2"
723
- tmp.exec %( mkdir #{ base_dir } && touch #{ base_dir } /dummy_file )
728
+ tmp.exec %( mkdir -p #{ base_dir } && touch #{ base_dir } /dummy_file_2 )
724
729
tmp.exec %( git add #{ base_dir } /)
725
- tmp.exec %( git commit --no-gpg-sign -m "breaking: 2 ")
730
+ tmp.exec %( git commit --no-gpg-sign -m "breaking: 3 ")
726
731
727
732
# git-version should accept the breaking tag on commit with dir2
728
733
version = git.get_version
729
734
hash = git.current_commit_hash
730
- version.should eq(" dir2-2.0.0-SNAPSHOT.0 .#{ hash } " )
735
+ version.should eq(" dir2-2.0.0-SNAPSHOT.1 .#{ hash } " )
731
736
ensure
732
737
tmp.cleanup
733
738
end
0 commit comments