File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 55 ENV [ 'PROJECT_ROOT_FOLDER' ] = nil
66 end
77
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+
832 describe '#android_update_release_notes' do
933 it 'adds a new section on RELEASE-NOTES.txt' do
1034 in_tmp_dir do |tmp_dir |
1135 # Arrange
1236 ENV [ 'PROJECT_ROOT_FOLDER' ] = tmp_dir
1337 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 )
1539
1640 # Act
1741 run_described_fastlane_action (
1842 new_version : '1.0'
1943 )
2044
2145 # 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 )
2347 end
2448 end
2549
2852 # Arrange
2953 ENV [ 'PROJECT_ROOT_FOLDER' ] = tmp_dir
3054 changelog_md = File . join ( tmp_dir , 'CHANGELOG.md' )
31- File . write ( changelog_md , ANDROID_FAKE_CONTENT )
55+ File . write ( changelog_md , content )
3256
3357 # Act
3458 run_described_fastlane_action (
3761 )
3862
3963 # 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 )
4165 end
4266 end
4367 end
4468end
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 55 ENV [ 'PROJECT_ROOT_FOLDER' ] = nil
66 end
77
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+
832 describe '#ios_update_release_notes' do
933 it 'adds a new section on RELEASE-NOTES.txt' do
1034 in_tmp_dir do |tmp_dir |
1135 # Arrange
1236 ENV [ 'PROJECT_ROOT_FOLDER' ] = tmp_dir
1337 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 )
1539
1640 # Act
1741 run_described_fastlane_action (
1842 new_version : '1.0'
1943 )
2044
2145 # 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 )
2347 end
2448 end
2549
2852 # Arrange
2953 ENV [ 'PROJECT_ROOT_FOLDER' ] = tmp_dir
3054 changelog_md = File . join ( tmp_dir , 'CHANGELOG.md' )
31- File . write ( changelog_md , IOS_FAKE_CONTENT )
55+ File . write ( changelog_md , content )
3256
3357 # Act
3458 run_described_fastlane_action (
3761 )
3862
3963 # 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 )
4165 end
4266 end
4367 end
4468end
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