update resource unit tests
This commit is contained in:
Родитель
928fd8099c
Коммит
68a2661f03
|
@ -9,7 +9,7 @@ module MacOS
|
|||
if download_url.empty?
|
||||
developer_id = validate_apple_id(apple_id_hash)
|
||||
@credentials = {
|
||||
XCODE_INSTALL_USER: developer_id[:apple_id],
|
||||
XCODE_INSTALL_USER: developer_id[:username],
|
||||
XCODE_INSTALL_PASSWORD: developer_id[:password],
|
||||
}
|
||||
authenticate_with_apple(@credentials)
|
||||
|
@ -19,12 +19,12 @@ module MacOS
|
|||
def validate_apple_id(apple_id_hash)
|
||||
if apple_id_hash.values.any?
|
||||
{
|
||||
apple_id: apple_id_hash[:username],
|
||||
username: apple_id_hash[:username],
|
||||
password: apple_id_hash[:password],
|
||||
}
|
||||
elsif ENV['XCODE_INSTALL_USER'] && ENV['XCODE_INSTALL_PASSWORD']
|
||||
{
|
||||
apple_id: ENV['XCODE_INSTALL_USER'],
|
||||
username: ENV['XCODE_INSTALL_USER'],
|
||||
password: ENV['XCODE_INSTALL_PASSWORD'],
|
||||
}
|
||||
else
|
||||
|
|
|
@ -4,10 +4,9 @@ describe 'xcode' do
|
|||
step_into :xcode
|
||||
platform 'mac_os_x'
|
||||
|
||||
default_attributes['macos']['apple_id']['user'] = 'developer@apple.com'
|
||||
default_attributes['macos']['apple_id']['password'] = 'apple_id_password'
|
||||
|
||||
before(:each) do
|
||||
allow_any_instance_of(MacOS::DeveloperAccount).to receive(:validate_apple_id)
|
||||
.and_return({ username: 'user@example', password: 'placeholder' })
|
||||
allow_any_instance_of(MacOS::DeveloperAccount).to receive(:authenticate_with_apple)
|
||||
.and_return(true)
|
||||
allow(MacOS::XCVersion).to receive(:available_versions)
|
||||
|
|
Загрузка…
Ссылка в новой задаче