如何让 Cocoapods.org 发现我的 pod 有测试?

How can I make Cocoapods.org discover that my pod has Tests?

我在 Cocoapods 上有一个带测试的 pod,但是 cocoapods.org 说 pod 没有测试。我该怎么做?我做错了什么?

https://cocoapods.org/pods/SearchEmojiOnString https://github.com/GabrielMassana/SearchEmojiOnString-iOS

代码并不太复杂: https://github.com/CocoaPods/cocoadocs.org/blob/master/classes/testing_idealist.rb

大致:

  • 获取根目录下的所有项目
  • 获取那些项目中的所有测试目标
  • 遍历所有相关文件,寻找常见的测试模式
  • 通过正则表达式寻找共同期望,例如

    regexes = [/XCTAssert|XCTFail/, # XCTest /expect\(/, # Expecta, Nimble /should\]|shouldNot\]/, # Kiwi /assertThat/, # OCHamcrest / should .*;| should_not |expect\(/, # Cedar /FBSnapshotVerify/ # FBSnapshotTestCase ]

  • 计算所有这些匹配项,并将该数字 into the DB 设为 total_test_expectations

根据我的内联评论判断,我们之前在 Xcode 项目中遇到过 Unicode 问题。也许这是你的问题,如果你能弄清楚,将不胜感激。