TestsTested | ✗ |
LangLanguage | Obj-CObjective C |
License | Apache 2 |
ReleasedLast Release | Dec 2014 |
Maintained by Unclaimed.
The iOS SDK gives developers access to two global variables that will enable additional logging statements when using the Core Data integration:
application:DidFinishLaunchingWithOptions:
method, include the line SM_CORE_DATA_DEBUG = YES;
to turn on log statements from SMIncrementalStore
. This will provide information about the data store calls to StackMob happening behind the scenes during Core Data saves and fetches. The default is NO
.In order to test you must download the full source code: `git clone [email protected]:stackmob/stackmob-ios-sdk.git`.
Kiwi specs run just like OCUnit tests. In Xcode ⌘U
will run all the tests for the currently selected scheme.
describe(@"a public method or feature", ^{
beforeEach(^{
//set up
[[someClass stubAndReturn:aResult] aMethod];
});
context(@"when some precondition exists", ^{
beforeEach(^{
//set the precondition
});
it(@"should have a specific behavior", ^{
//verify the behavior
[[aThing shouldNot] equal:someOtherThing];
});
pending(@"should eventually have another behavior", ^{
//pending specs will not execute and generate warnings
[[[anObject should] receive] aMethodWith:anArgument];
[anObject doStuff];
});
context(@"and another condition exists", ^{
//...
});
});
});
Unit tests do not make network requests against StackMob. The project includes a seperate target of integration tests to verify communication with the StackMob API.
cp integration\ tests/StackMobCredentials.plist.example integration\ tests/StackMobCredentials.plist
open integration\ tests/StackMobCredentials.plist
places
. Add
a geopoint field called location
and set all Schema Permissions to Open
.oauth2test
. Add a string field called name
and set all Schema Permissions to Allow to any logged in user
.
By default, custom code tests are turned off. This is because they require you to have specific custom code methods uploaded for your application. To test custom code, do the following:
$ git clone [email protected]:stackmob/stackmob-customcode-example.git
./java/src/main/java/com/stackmob/example/
./example
folder with the files provided by stackmob-ios-sdk. They can be found by navigating from the root of your local stackmob-ios-sdk folder to /integration tests/CustomCodeFiles
. The files are EntryPointExtender.java
, HelloWorld.java
, and HelloWorldParams.java
.$ mvn clean package
.stackmob.com
and click on Manage Custom Code
in the left sidebar..jar
file located, from the root of your local stackmob-customcode-example folder, in /java/target/
. It's the only .jar
file there, and NOT the .one-jar.jar
. You should get feedback from the browser that the methods hello_world
and hello_world_params
have successfully been uploaded - it reports the version and create date.SMIntegrationTestHelpers.h
in the folder Integration Tests
. You will see #define TEST_CUSTOM_CODE 0
. Just change that to a 1
and when you test the "integration tests" scheme you will run the custom code tests found in SMCusCodeReqIntegrationSpec.m
.git checkout -b make_sdk_better development
.git merge development
(git rebase development
for local branches if you prefer).git push origin make_sdk_better
.