cocoapodsをインストールする
gem install cocoapods
Inside the project’s directory, generate the pod file:
pod init
まずは、xcodeで何かしらプロジェクトを作る
その後、プロジェクトフォルダの直下に移動し
以下ファイルを作成
server:プロジェクト名 shiratsu$ cat Podfile
platform :ios, '7.0'
# Add Kiwi as an exclusive dependency for the AmazingAppTests target
target :プロジェクト名Tests, :exclusive => true do
pod 'Kiwi'
end
# If you're using Xcode 5 with a brand new project
# (XCTest based instead of OCUnit based) use this instead:
target :プロジェクト名Tests, :exclusive => true do
pod 'Kiwi/XCTest'
end
pod install
を実行
open プロジェクト名.xcworkspace
これで,kiwiが使えるようになってます
テストケース
# import <XCTest/XCTest.h>
# import "Kiwi.h"
SPEC_BEGIN(MathSpec)
describe(@"Math", ^{
it(@"この計算式は合っておる", ^{
NSUInteger a = 16;
NSUInteger b = 26;
[[theValue(a + b) should] equal:theValue(42)];
});
});
SPEC_END