File tree Expand file tree Collapse file tree 2 files changed +56
-50
lines changed Expand file tree Collapse file tree 2 files changed +56
-50
lines changed Original file line number Diff line number Diff line change 5
5
ENV [ 'PROJECT_ROOT_FOLDER' ] = nil
6
6
end
7
7
8
+ let ( :new_section ) do
9
+ <<~CONTENT
10
+ 1.1
11
+ -----
12
+
13
+
14
+ CONTENT
15
+ end
16
+ let ( :content ) do
17
+ <<~CONTENT
18
+ 1.0
19
+ -----
20
+ - Item 1 for v1.0
21
+ - Item 2 for v1.0
22
+
23
+ // Comment in the middle
24
+
25
+ 0.9.0
26
+ -----
27
+ - Item 1 for v0.9.0
28
+ - Item 2 for v0.9.0
29
+ CONTENT
30
+ end
31
+
8
32
describe '#android_update_release_notes' do
9
33
it 'adds a new section on RELEASE-NOTES.txt' do
10
34
in_tmp_dir do |tmp_dir |
11
35
# Arrange
12
36
ENV [ 'PROJECT_ROOT_FOLDER' ] = tmp_dir
13
37
release_notes_txt = File . join ( tmp_dir , 'RELEASE-NOTES.txt' )
14
- File . write ( release_notes_txt , ANDROID_FAKE_CONTENT )
38
+ File . write ( release_notes_txt , content )
15
39
16
40
# Act
17
41
run_described_fastlane_action (
18
42
new_version : '1.0'
19
43
)
20
44
21
45
# Assert
22
- expect ( File . read ( release_notes_txt ) ) . to eq ( ANDROID_NEW_SECTION + ANDROID_FAKE_CONTENT )
46
+ expect ( File . read ( release_notes_txt ) ) . to eq ( new_section + content )
23
47
end
24
48
end
25
49
28
52
# Arrange
29
53
ENV [ 'PROJECT_ROOT_FOLDER' ] = tmp_dir
30
54
changelog_md = File . join ( tmp_dir , 'CHANGELOG.md' )
31
- File . write ( changelog_md , ANDROID_FAKE_CONTENT )
55
+ File . write ( changelog_md , content )
32
56
33
57
# Act
34
58
run_described_fastlane_action (
37
61
)
38
62
39
63
# Assert
40
- expect ( File . read ( changelog_md ) ) . to eq ( ANDROID_NEW_SECTION + ANDROID_FAKE_CONTENT )
64
+ expect ( File . read ( changelog_md ) ) . to eq ( new_section + content )
41
65
end
42
66
end
43
67
end
44
68
end
45
-
46
- ANDROID_FAKE_CONTENT = <<~CONTENT . freeze
47
- 1.0
48
- -----
49
- - Item 1 for v1.0
50
- - Item 2 for v1.0
51
-
52
- // Comment in the middle
53
-
54
- 0.9.0
55
- -----
56
- - Item 1 for v0.9.0
57
- - Item 2 for v0.9.0
58
- CONTENT
59
-
60
- ANDROID_NEW_SECTION = <<~CONTENT . freeze
61
- 1.1
62
- -----
63
-
64
-
65
- CONTENT
Original file line number Diff line number Diff line change 5
5
ENV [ 'PROJECT_ROOT_FOLDER' ] = nil
6
6
end
7
7
8
+ let ( :new_section ) do
9
+ <<~CONTENT
10
+ 1.1
11
+ -----
12
+
13
+
14
+ CONTENT
15
+ end
16
+ let ( :content ) do
17
+ <<~CONTENT
18
+ 1.0
19
+ -----
20
+ - Item 1 for v1.0
21
+ - Item 2 for v1.0
22
+
23
+ // Comment in the middle
24
+
25
+ 0.9.0
26
+ -----
27
+ - Item 1 for v0.9.0
28
+ - Item 2 for v0.9.0
29
+ CONTENT
30
+ end
31
+
8
32
describe '#ios_update_release_notes' do
9
33
it 'adds a new section on RELEASE-NOTES.txt' do
10
34
in_tmp_dir do |tmp_dir |
11
35
# Arrange
12
36
ENV [ 'PROJECT_ROOT_FOLDER' ] = tmp_dir
13
37
release_notes_txt = File . join ( tmp_dir , 'RELEASE-NOTES.txt' )
14
- File . write ( release_notes_txt , IOS_FAKE_CONTENT )
38
+ File . write ( release_notes_txt , content )
15
39
16
40
# Act
17
41
run_described_fastlane_action (
18
42
new_version : '1.0'
19
43
)
20
44
21
45
# Assert
22
- expect ( File . read ( release_notes_txt ) ) . to eq ( IOS_NEW_SECTION + IOS_FAKE_CONTENT )
46
+ expect ( File . read ( release_notes_txt ) ) . to eq ( new_section + content )
23
47
end
24
48
end
25
49
28
52
# Arrange
29
53
ENV [ 'PROJECT_ROOT_FOLDER' ] = tmp_dir
30
54
changelog_md = File . join ( tmp_dir , 'CHANGELOG.md' )
31
- File . write ( changelog_md , IOS_FAKE_CONTENT )
55
+ File . write ( changelog_md , content )
32
56
33
57
# Act
34
58
run_described_fastlane_action (
37
61
)
38
62
39
63
# Assert
40
- expect ( File . read ( changelog_md ) ) . to eq ( IOS_NEW_SECTION + IOS_FAKE_CONTENT )
64
+ expect ( File . read ( changelog_md ) ) . to eq ( new_section + content )
41
65
end
42
66
end
43
67
end
44
68
end
45
-
46
- IOS_FAKE_CONTENT = <<~CONTENT . freeze
47
- 1.0
48
- -----
49
- - Item 1 for v1.0
50
- - Item 2 for v1.0
51
-
52
- // Comment in the middle
53
-
54
- 0.9.0
55
- -----
56
- - Item 1 for v0.9.0
57
- - Item 2 for v0.9.0
58
- CONTENT
59
-
60
- IOS_NEW_SECTION = <<~CONTENT . freeze
61
- 1.1
62
- -----
63
-
64
-
65
- CONTENT
You can’t perform that action at this time.
0 commit comments