See here for installation/setup instructions: https://github.com/ericmeyer/OCSlim-Templates
This provides a way to write acceptance tests for your iOS and other Objective C applications using Slim tables and fixtures written in Objective C.
http://fitnesse.org/FitNesse.UserGuide.SliM has more information about what Slim is.
https://github.com/dougbradbury/cslim
This project is an example project using the cslim project as a dependency via a git submodule. If you make changes/additions to Objective C Slim, make sure to push those to the cslim project. Also, new files should typically be added to the cslim submodule.
Note: Some of the examples intentionally give errors or warnings.
- Clone this project.
- Run
git submodule init
- Run
git submodule update
- Open the project in Xcode.
- Run
./bin/StartFitnesse
- Open a browser to http://localhost:8080/CslimFirstExamples
- Click "Suite" near the top left corner.
- See results.
Soon to be replaced with a template for an acceptance test target.
- Create a new project or open an existing project
- Checkout https://github.com/dougbradbury/cslim into your project.
- Create a new target and call it AcceptanceTests.
- Add all the header files from the following directories to the project. Make sure they are a included in the AcceptanceTests target.
- include/Com
- include/CSlim
- Add all the src files from the following directories to the project. Make sure they are a included in the AcceptanceTests target.
- src/Com
- src/CSlim
- src/ExecutorObjectiveC
- Download fitnesse.jar into the root of your project.
- Start fitnesse and write some tests. See http://fitnesse.org/FitNesse.UserGuide.SliM for help in writing and running Slim tests.
- Write new fixtures in Xcode, making sure to add them to the AcceptanceTests target.
- Run the tests in fitnesse.
Currently, the target AcceptanceTests will not actually run the tests. Instead it just builds the fixtures.
Use this as a starting point for the contents of your Fitnesse page that is your top level suite. It has been copy pasted from http://localhost:8080/CslimFirstExamples?edit while fitnesse is running on your local machine.
!contents -R2 -g -p -f -h !define TEST_SYSTEM {slim} !define TEST_RUNNER {build/Debug/AcceptanceTests.app/Contents/MacOS/AcceptanceTests} !define COMMAND_PATTERN {%m} !define SLIM_VERSION {0.0}
Fixture methods that take one argument expect an NSString Fixture methods that take more than one argument expect an NSArray of NSString's. All fixture methods return an NSString See ObjAdderFixture for an example of a decision table See Count for an example of a script table
Converting Strings to number primitives:
- [@"123" intValue];
- [@"3.50" doubleValue];
- [@"3.14" floatValue];
Converting to an NSString
- From an NSNumber
- NSNumber* number = [NSNumber numberWithInt: 1];
- [number stringValue];
- General case
- [NSString stringWithFormat: @"%@, %@", @"Lastname", @"Firstname"];