Class: TestCenter::Helper::XCTestrunInfo

Inherits:
Object
  • Object
show all
Defined in:
lib/fastlane/plugin/test_center/helper/xctestrun_info.rb

Instance Method Summary collapse

Constructor Details

#initialize(xctestrun_filepath) ⇒ XCTestrunInfo

Returns a new instance of XCTestrunInfo.

Raises:

  • (Errno::ENOENT)


6
7
8
9
10
11
# File 'lib/fastlane/plugin/test_center/helper/xctestrun_info.rb', line 6

def initialize(xctestrun_filepath)
  raise Errno::ENOENT, xctestrun_filepath unless File.exist?(xctestrun_filepath)

  @xctestrun = Plist.parse_xml(xctestrun_filepath)
  @xctestrun_rootpath = File.dirname(xctestrun_filepath)
end

Instance Method Details

#app_path_for_testable(testable) ⇒ Object



13
14
15
16
17
# File 'lib/fastlane/plugin/test_center/helper/xctestrun_info.rb', line 13

def app_path_for_testable(testable)
  @xctestrun[testable].fetch('UITargetAppPath') do |_|
    @xctestrun[testable]['TestHostPath']
  end.sub('__TESTROOT__', @xctestrun_rootpath)
end

#app_plist_for_testable(testable) ⇒ Object



19
20
21
22
23
# File 'lib/fastlane/plugin/test_center/helper/xctestrun_info.rb', line 19

def app_plist_for_testable(testable)
  binary_plistfile = File.join(app_path_for_testable(testable), 'Info.plist')

  Plist.parse_binary_xml(binary_plistfile)
end