deployments 0.1.5 → 0.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/deployments/project.rb +1 -1
- data/lib/deployments/version.rb +1 -1
- data/spec/project_spec.rb +11 -1
- metadata +1 -1
data/lib/deployments/project.rb
CHANGED
@@ -30,7 +30,7 @@ module Deployments
|
|
30
30
|
end
|
31
31
|
|
32
32
|
def previous_tag
|
33
|
-
tag_name = File.read(VERSION_FILE) if File.exists?(VERSION_FILE)
|
33
|
+
tag_name = File.read(VERSION_FILE).strip if File.exists?(VERSION_FILE)
|
34
34
|
tag_name ||= tag_names[tag_names.size - 2]
|
35
35
|
|
36
36
|
find_repo_tag(tag_name)
|
data/lib/deployments/version.rb
CHANGED
data/spec/project_spec.rb
CHANGED
@@ -60,10 +60,11 @@ describe Project do
|
|
60
60
|
|
61
61
|
context "when we have version.txt file in public folder" do
|
62
62
|
let(:project_path) { './spec/fixtures/repositories/tags/dot_git' }
|
63
|
+
let(:tag_name) { "1.1.1" }
|
63
64
|
|
64
65
|
before do
|
65
66
|
File.open(VERSION_FILE, "w") do |file|
|
66
|
-
file.write
|
67
|
+
file.write tag_name
|
67
68
|
end
|
68
69
|
end
|
69
70
|
|
@@ -73,6 +74,15 @@ describe Project do
|
|
73
74
|
project.commits.to_s.should include("Change readme file")
|
74
75
|
project.commits.to_s.should include("Add empty space to readme file")
|
75
76
|
end
|
77
|
+
|
78
|
+
context "with empty characters at the end of tag name" do
|
79
|
+
let(:tag_name) { "1.1.1\r\n" }
|
80
|
+
|
81
|
+
it "should use version file for collecting commits" do
|
82
|
+
project.commits.to_s.should include("Change readme file")
|
83
|
+
project.commits.to_s.should include("Add empty space to readme file")
|
84
|
+
end
|
85
|
+
end
|
76
86
|
end
|
77
87
|
|
78
88
|
context "with one commit between tags" do
|