File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 99 VERSION_LONG = 6.30.0
1010 CONTENT
1111
12- allow ( File ) . to receive ( :exist? ) . and_return ( true )
13-
1412 expect_version ( xcconfig_mock_content : xcconfig_mock_content , expected_version : '6.30' )
1513 end
1614
2119 VERSION_LONG = 6.30.1
2220 CONTENT
2321
24- allow ( File ) . to receive ( :exist? ) . and_return ( true )
25-
2622 expect_version ( xcconfig_mock_content : xcconfig_mock_content , expected_version : '6.30.1' )
2723 end
2824
4238 // a comment
4339 CONTENT
4440
45- allow ( File ) . to receive ( :exist? ) . and_return ( true )
46-
4741 expect do
4842 expect_version ( xcconfig_mock_content : xcconfig_mock_content , expected_version : 'n/a' )
4943 end . to raise_error ( FastlaneCore ::Interface ::FastlaneError )
5044 end
5145
5246 def expect_version ( xcconfig_mock_content :, expected_version :)
53- xcconfig_mock_file_path = File . join ( 'mock' , 'file' , 'path' )
54-
55- allow ( File ) . to receive ( :open ) . with ( xcconfig_mock_file_path , 'r' ) . and_yield ( StringIO . new ( xcconfig_mock_content ) )
47+ allow ( File ) . to receive ( :exist? ) . and_return ( true )
5648
57- version_result = run_described_fastlane_action (
58- public_version_xcconfig_file : xcconfig_mock_file_path
59- )
49+ with_tmp_file ( named : 'mock_xcconfig.xcconfig' , content : xcconfig_mock_content ) do |tmp_file_path |
50+ version_result = run_described_fastlane_action (
51+ public_version_xcconfig_file : tmp_file_path
52+ )
6053
61- expect ( version_result ) . to eq ( expected_version )
54+ expect ( version_result ) . to eq ( expected_version )
55+ end
6256 end
6357 end
6458end
You can’t perform that action at this time.
0 commit comments