update unit tests with changes to available_versions output
This commit is contained in:
Родитель
e924aa5f3b
Коммит
09e87f740d
|
@ -6,88 +6,87 @@ describe MacOS::Xcode do
|
|||
before do
|
||||
allow_any_instance_of(MacOS::Xcode).to receive(:installed_path).and_return nil
|
||||
allow(MacOS::XCVersion).to receive(:available_versions)
|
||||
.and_return(["4.3 for Lion\n",
|
||||
"4.3.1 for Lion\n",
|
||||
"4.3.2 for Lion\n",
|
||||
"4.3.3 for Lion\n",
|
||||
"4.4\n",
|
||||
"4.4.1\n",
|
||||
"4.5\n",
|
||||
"4.5.1\n",
|
||||
"4.5.2\n",
|
||||
"4.6\n",
|
||||
"4.6.1\n",
|
||||
"4.6.2\n",
|
||||
"4.6.3\n",
|
||||
"5\n",
|
||||
"5.0.1\n",
|
||||
"5.0.2\n",
|
||||
"5.1\n",
|
||||
"5.1.1\n",
|
||||
"6.0.1\n",
|
||||
"6.1\n",
|
||||
"6.1.1\n",
|
||||
"6.2\n",
|
||||
"6.3\n",
|
||||
"6.3.1\n",
|
||||
"6.3.2\n",
|
||||
"6.4\n",
|
||||
"7\n",
|
||||
"7.0.1\n",
|
||||
"7.1\n",
|
||||
"7.1.1\n",
|
||||
"7.2\n",
|
||||
"7.2.1\n",
|
||||
"7.3\n",
|
||||
"7.3.1\n",
|
||||
"8\n",
|
||||
"8.1\n",
|
||||
"8.2\n",
|
||||
"8.2.1\n",
|
||||
"8.3\n",
|
||||
"8.3.1\n",
|
||||
"8.3.2\n",
|
||||
"8.3.3\n",
|
||||
"9\n",
|
||||
"9.0.1\n",
|
||||
"9.1\n",
|
||||
"9.2\n",
|
||||
"9.3\n",
|
||||
"9.4.1\n",
|
||||
"9.4.2 beta 2\n",
|
||||
"9.4.2\n",
|
||||
"10 beta 1\n",
|
||||
"10 GM seed\n",
|
||||
"10\n",
|
||||
"10.1\n",
|
||||
"10.2.1\n",
|
||||
"10.2\n",
|
||||
"10.3\n",
|
||||
"11\n",
|
||||
"11.1\n",
|
||||
"11.2\n",
|
||||
"11.2.1\n",
|
||||
"11.3\n",
|
||||
"11.3 beta\n",
|
||||
"11.3.1\n",
|
||||
"11.4 beta\n",
|
||||
"11.4\n",
|
||||
"11.4 beta 3\n",
|
||||
"11.4 beta 2\n",
|
||||
"11.4.1\n",
|
||||
"11.5 beta\n",
|
||||
"11.5\n",
|
||||
"11.5 GM Seed\n",
|
||||
"11.5 beta 2\n",
|
||||
"11.6 beta\n",
|
||||
"11.6 beta 2\n",
|
||||
"12 beta 4\n",
|
||||
"12 for macOS Universal Apps beta\n",
|
||||
"12 beta 3\n",
|
||||
"12 beta 2\n",
|
||||
"12 for macOS Universal Apps beta 2\n",
|
||||
"12 beta\n"]
|
||||
)
|
||||
.and_return(['4.3 for Lion',
|
||||
'4.3.1 for Lion',
|
||||
'4.3.2 for Lion',
|
||||
'4.3.3 for Lion',
|
||||
'4.4',
|
||||
'4.4.1',
|
||||
'4.5',
|
||||
'4.5.1',
|
||||
'4.5.2',
|
||||
'4.6',
|
||||
'4.6.1',
|
||||
'4.6.2',
|
||||
'4.6.3',
|
||||
'5',
|
||||
'5.0.1',
|
||||
'5.0.2',
|
||||
'5.1',
|
||||
'5.1.1',
|
||||
'6.0.1',
|
||||
'6.1',
|
||||
'6.1.1',
|
||||
'6.2',
|
||||
'6.3',
|
||||
'6.3.1',
|
||||
'6.3.2',
|
||||
'6.4',
|
||||
'7',
|
||||
'7.0.1',
|
||||
'7.1',
|
||||
'7.1.1',
|
||||
'7.2',
|
||||
'7.2.1',
|
||||
'7.3',
|
||||
'7.3.1',
|
||||
'8',
|
||||
'8.1',
|
||||
'8.2',
|
||||
'8.2.1',
|
||||
'8.3',
|
||||
'8.3.1',
|
||||
'8.3.2',
|
||||
'8.3.3',
|
||||
'9',
|
||||
'9.0.1',
|
||||
'9.1',
|
||||
'9.2',
|
||||
'9.3',
|
||||
'9.4.1',
|
||||
'9.4.2 beta 2',
|
||||
'9.4.2',
|
||||
'10 beta 1',
|
||||
'10 GM seed',
|
||||
'10',
|
||||
'10.1',
|
||||
'10.2.1',
|
||||
'10.2',
|
||||
'10.3',
|
||||
'11',
|
||||
'11.1',
|
||||
'11.2',
|
||||
'11.2.1',
|
||||
'11.3',
|
||||
'11.3 beta',
|
||||
'11.3.1',
|
||||
'11.4 beta',
|
||||
'11.4',
|
||||
'11.4 beta 3',
|
||||
'11.4 beta 2',
|
||||
'11.4.1',
|
||||
'11.5 beta',
|
||||
'11.5',
|
||||
'11.5 GM Seed',
|
||||
'11.5 beta 2',
|
||||
'11.6 beta',
|
||||
'11.6 beta 2',
|
||||
'12 beta 4',
|
||||
'12 for macOS Universal Apps beta',
|
||||
'12 beta 3',
|
||||
'12 beta 2',
|
||||
'12 for macOS Universal Apps beta 2',
|
||||
'12 beta'])
|
||||
end
|
||||
it 'returns the name of the latest Xcode 12 beta when initialized with the semantic version' do
|
||||
xcode = MacOS::Xcode.new('12.0', '/Applications/Xcode.app')
|
||||
|
@ -195,7 +194,7 @@ end
|
|||
describe MacOS::Xcode do
|
||||
context 'when initialized with an Xcode download url and Xcode betas available' do
|
||||
before do
|
||||
allow(MacOS::XCVersion).to receive(:available_versions).and_return(["10 GM seed\n"])
|
||||
allow(MacOS::XCVersion).to receive(:available_versions).and_return(['10 GM seed'])
|
||||
end
|
||||
it 'returns the download url' do
|
||||
xcode = MacOS::Xcode.new('10.0', '/Applications/Xcode.app', 'https://www.apple.com')
|
||||
|
|
|
@ -11,7 +11,7 @@ describe MacOS::XCVersion do
|
|||
|
||||
context 'when given an Xcode object without a download url' do
|
||||
before do
|
||||
allow(MacOS::XCVersion).to receive(:available_versions).and_return(["10 GM seed\n"])
|
||||
allow(MacOS::XCVersion).to receive(:available_versions).and_return(['10 GM seed'])
|
||||
allow(MacOS::XCVersion).to receive(:xcversion_path).and_return('/foo/bar/bin/xcversion')
|
||||
end
|
||||
|
||||
|
|
|
@ -11,86 +11,86 @@ describe 'xcode' do
|
|||
allow_any_instance_of(MacOS::DeveloperAccount).to receive(:authenticate_with_apple)
|
||||
.and_return(true)
|
||||
allow(MacOS::XCVersion).to receive(:available_versions)
|
||||
.and_return(["4.3 for Lion\n",
|
||||
"4.3.1 for Lion\n",
|
||||
"4.3.2 for Lion\n",
|
||||
"4.3.3 for Lion\n",
|
||||
"4.4\n",
|
||||
"4.4.1\n",
|
||||
"4.5\n",
|
||||
"4.5.1\n",
|
||||
"4.5.2\n",
|
||||
"4.6\n",
|
||||
"4.6.1\n",
|
||||
"4.6.2\n",
|
||||
"4.6.3\n",
|
||||
"5\n",
|
||||
"5.0.1\n",
|
||||
"5.0.2\n",
|
||||
"5.1\n",
|
||||
"5.1.1\n",
|
||||
"6.0.1\n",
|
||||
"6.1\n",
|
||||
"6.1.1\n",
|
||||
"6.2\n",
|
||||
"6.3\n",
|
||||
"6.3.1\n",
|
||||
"6.3.2\n",
|
||||
"6.4\n",
|
||||
"7\n",
|
||||
"7.0.1\n",
|
||||
"7.1\n",
|
||||
"7.1.1\n",
|
||||
"7.2\n",
|
||||
"7.2.1\n",
|
||||
"7.3\n",
|
||||
"7.3.1\n",
|
||||
"8\n",
|
||||
"8.1\n",
|
||||
"8.2\n",
|
||||
"8.2.1\n",
|
||||
"8.3\n",
|
||||
"8.3.1\n",
|
||||
"8.3.2\n",
|
||||
"8.3.3\n",
|
||||
"9\n",
|
||||
"9.0.1\n",
|
||||
"9.1\n",
|
||||
"9.2\n",
|
||||
"9.3\n",
|
||||
"9.4.1\n",
|
||||
"9.4.2 beta 2\n",
|
||||
"9.4.2\n",
|
||||
"10 beta 1\n",
|
||||
"10 GM seed\n",
|
||||
"10\n",
|
||||
"10.1\n",
|
||||
"10.2.1\n",
|
||||
"10.2\n",
|
||||
"10.3\n",
|
||||
"11\n",
|
||||
"11.1\n",
|
||||
"11.2\n",
|
||||
"11.2.1\n",
|
||||
"11.3 beta\n",
|
||||
"11.3\n",
|
||||
"11.3.1\n",
|
||||
"11.4 beta\n",
|
||||
"11.4\n",
|
||||
"11.4 beta 3\n",
|
||||
"11.4 beta 2\n",
|
||||
"11.4.1\n",
|
||||
"11.5 beta\n",
|
||||
"11.5\n",
|
||||
"11.5 GM Seed\n",
|
||||
"11.5 beta 2\n",
|
||||
"11.6 beta\n",
|
||||
"12 beta 4\n",
|
||||
"12 for macOS Universal Apps beta\n",
|
||||
"12 beta 3\n",
|
||||
"12 beta 2\n",
|
||||
"12 for macOS Universal Apps beta 2\n",
|
||||
"12 beta\n"])
|
||||
.and_return(['4.3 for Lion',
|
||||
'4.3.1 for Lion',
|
||||
'4.3.2 for Lion',
|
||||
'4.3.3 for Lion',
|
||||
'4.4',
|
||||
'4.4.1',
|
||||
'4.5',
|
||||
'4.5.1',
|
||||
'4.5.2',
|
||||
'4.6',
|
||||
'4.6.1',
|
||||
'4.6.2',
|
||||
'4.6.3',
|
||||
'5',
|
||||
'5.0.1',
|
||||
'5.0.2',
|
||||
'5.1',
|
||||
'5.1.1',
|
||||
'6.0.1',
|
||||
'6.1',
|
||||
'6.1.1',
|
||||
'6.2',
|
||||
'6.3',
|
||||
'6.3.1',
|
||||
'6.3.2',
|
||||
'6.4',
|
||||
'7',
|
||||
'7.0.1',
|
||||
'7.1',
|
||||
'7.1.1',
|
||||
'7.2',
|
||||
'7.2.1',
|
||||
'7.3',
|
||||
'7.3.1',
|
||||
'8',
|
||||
'8.1',
|
||||
'8.2',
|
||||
'8.2.1',
|
||||
'8.3',
|
||||
'8.3.1',
|
||||
'8.3.2',
|
||||
'8.3.3',
|
||||
'9',
|
||||
'9.0.1',
|
||||
'9.1',
|
||||
'9.2',
|
||||
'9.3',
|
||||
'9.4.1',
|
||||
'9.4.2 beta 2',
|
||||
'9.4.2',
|
||||
'10 beta 1',
|
||||
'10 GM seed',
|
||||
'10',
|
||||
'10.1',
|
||||
'10.2.1',
|
||||
'10.2',
|
||||
'10.3',
|
||||
'11',
|
||||
'11.1',
|
||||
'11.2',
|
||||
'11.2.1',
|
||||
'11.3 beta',
|
||||
'11.3',
|
||||
'11.3.1',
|
||||
'11.4 beta',
|
||||
'11.4',
|
||||
'11.4 beta 3',
|
||||
'11.4 beta 2',
|
||||
'11.4.1',
|
||||
'11.5 beta',
|
||||
'11.5',
|
||||
'11.5 GM Seed',
|
||||
'11.5 beta 2',
|
||||
'11.6 beta',
|
||||
'12 beta 4',
|
||||
'12 for macOS Universal Apps beta',
|
||||
'12 beta 3',
|
||||
'12 beta 2',
|
||||
'12 for macOS Universal Apps beta 2',
|
||||
'12 beta'])
|
||||
allow(File).to receive(:exist?).and_call_original
|
||||
allow(FileUtils).to receive(:touch).and_return(true)
|
||||
allow(FileUtils).to receive(:chown).and_return(true)
|
||||
|
@ -132,7 +132,10 @@ describe 'xcode' do
|
|||
it { is_expected.to run_execute('install Xcode 11.6 beta') }
|
||||
it { is_expected.to delete_link('/Applications/Xcode.app') }
|
||||
|
||||
it { is_expected.to run_execute('move /Applications/Xcode-11.6.beta.app to /Applications/Xcode.app').with(command: ['mv', '/Applications/Xcode-11.6.beta.app', '/Applications/Xcode.app']) }
|
||||
it {
|
||||
is_expected.to run_execute('move /Applications/Xcode-11.6.beta.app to /Applications/Xcode.app').with(command: ['mv',
|
||||
'/Applications/Xcode-11.6.beta.app', '/Applications/Xcode.app'])
|
||||
}
|
||||
it { is_expected.to run_execute('switch active Xcode to /Applications/Xcode.app') }
|
||||
end
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче