私は客観的なCとIOSの開発者にとってかなり新しいので何が起こっているのか分かりません。デフォルトのテストフレームワークを使用して目的Cテストを実行する場合:基本クラスを指定せずに定義されたクラス
私は私のテストを実行しようと、私は次のエラーを取得する:
..../Pods/Expecta/src/matchers/EXPMatchers+beCloseTo.m:4:1:
Class 'EXPFixCategoriesBugEXPMatcher_beCloseToWithinMatcher'
defined without specifying a base class
次のコードpeiceは、問題を生成する(ただし、それは私のものではありません、私はそれがAであると信じて私はポッドを通じて使用していますライブラリのいずれかからpeice):次のように
#import "EXPMatchers+beCloseTo.h"
#import "EXPMatcherHelpers.h"
EXPMatcherImplementationBegin(_beCloseToWithin, (id expected, id within)) {
prerequisite(^BOOL{
return [actual isKindOfClass:[NSNumber class]] &&
[expected isKindOfClass:[NSNumber class]] &&
([within isKindOfClass:[NSNumber class]] || (within == nil));
});
match(^BOOL{
double actualValue = [actual doubleValue];
double expectedValue = [expected doubleValue];
if (within != nil) {
double withinValue = [within doubleValue];
double lowerBound = expectedValue - withinValue;
double upperBound = expectedValue + withinValue;
return (actualValue >= lowerBound) && (actualValue <= upperBound);
} else {
double diff = fabs(actualValue - expectedValue);
actualValue = fabs(actualValue);
expectedValue = fabs(expectedValue);
double largest = (expectedValue > actualValue) ? expectedValue : actualValue;
return (diff <= largest * FLT_EPSILON);
}
});
failureMessageForTo(^NSString *{
if (within) {
return [NSString stringWithFormat:@"expected %@ to be close to %@ within %@",
EXPDescribeObject(actual), EXPDescribeObject(expected), EXPDescribeObject(within)];
} else {
return [NSString stringWithFormat:@"expected %@ to be close to %@",
EXPDescribeObject(actual), EXPDescribeObject(expected)];
}
});
failureMessageForNotTo(^NSString *{
if (within) {
return [NSString stringWithFormat:@"expected %@ not to be close to %@ within %@",
EXPDescribeObject(actual), EXPDescribeObject(expected), EXPDescribeObject(within)];
} else {
return [NSString stringWithFormat:@"expected %@ not to be close to %@",
EXPDescribeObject(actual), EXPDescribeObject(expected)];
}
});
}
EXPMatcherImplementationEnd
マイPODファイルが見えます:
platform :ios, 6.0
pod 'RestKit', '~> 0.20.0rc'
# Include optional Testing and Search components
pod 'RestKit/Testing', '~> 0.20.0rc'
pod 'RestKit/Search', '~> 0.20.0rc'
target :MTPROJTESTS do
pod 'Expecta', '~> 0.2.3' # expecta matchers
# pod 'Specta', '~> 0.1.11' # specta bdd framework
end
NEW ERRORココアポッドとEXPECTAを更新した後:ld: library not found for -lPods-test clang: error: linker command failed with exit code 1 (use -v to see invocation)
エラー:
Ld /Users/AUSER/Library/Developer/Xcode/DerivedData/MYIOSPROJProject-cmxbzcbzjfbvgncspsalqnjvlova/Build/Products/Debug-iphonesimulator/MYIOSPROJProjectTests.xctest/MYIOSPROJProjectTests normal i386
cd /Users/AUSER/Documents/Dev/MYIOSPROJProject/MYIOSPROJProject
setenv IPHONEOS_DEPLOYMENT_TARGET 7.0
setenv PATH "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch i386 -bundle -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.0.sdk -L/Users/AUSER/Library/Developer/Xcode/DerivedData/MYIOSPROJProject-cmxbzcbzjfbvgncspsalqnjvlova/Build/Products/Debug-iphonesimulator -F/Users/AUSER/Library/Developer/Xcode/DerivedData/MYIOSPROJProject-cmxbzcbzjfbvgncspsalqnjvlova/Build/Products/Debug-iphonesimulator -F/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.0.sdk/Developer/Library/Frameworks -F/Applications/Xcode.app/Contents/Developer/Library/Frameworks -F/Applications/Xcode.app/Contents/Developer/Library/Frameworks -filelist /Users/AUSER/Library/Developer/Xcode/DerivedData/MYIOSPROJProject-cmxbzcbzjfbvgncspsalqnjvlova/Build/Intermediates/MYIOSPROJProject.build/Debug-iphonesimulator/MYIOSPROJProjectTests.build/Objects-normal/i386/MYIOSPROJProjectTests.LinkFileList -bundle_loader /Users/AUSER/Library/Developer/Xcode/DerivedData/MYIOSPROJProject-cmxbzcbzjfbvgncspsalqnjvlova/Build/Products/Debug-iphonesimulator/MYIOSPROJProject.app/MYIOSPROJProject -Xlinker -objc_abi_version -Xlinker 2 -ObjC -framework CFNetwork -framework CoreData -framework CoreGraphics -framework Foundation -framework MobileCoreServices -framework Security -framework SystemConfiguration -fobjc-arc -fobjc-link-runtime -Xlinker -no_implicit_dylibs -mios-simulator-version-min=7.0 -framework XCTest -framework UIKit -framework Foundation -lPods-test -lPods-MYIOSPROJProjectTests -Xlinker -dependency_info -Xlinker /Users/AUSER/Library/Developer/Xcode/DerivedData/MYIOSPROJProject-cmxbzcbzjfbvgncspsalqnjvlova/Build/Intermediates/MYIOSPROJProject.build/Debug-iphonesimulator/MYIOSPROJProjectTests.build/Objects-normal/i386/MYIOSPROJProjectTests_dependency_info.dat -o /Users/AUSER/Library/Developer/Xcode/DerivedData/MYIOSPROJProject-cmxbzcbzjfbvgncspsalqnjvlova/Build/Products/Debug-iphonesimulator/MYIOSPROJProjectTests.xctest/MYIOSPROJProjectTests
を私はそこに誰かが手がかり:)
基本クラスを指定せずに.hファイルの1つで '@interface'を使ってクラスを宣言したことがあります(つまり、コロンとコロンがない行を' @interface MyClass:BaseClass ')。 – godel9
ソリューションを実行したりビルドしたりするときにソリューションがコンパイルされます - テストを実行したときにのみ(そして1つのテストのみ)失敗します... – Aziz
ポッドファイルをポストできますか? Expecta –