Skip to content

Commit

Permalink
Updates to documentation reflect preference for OCHamcrest matchers o…
Browse files Browse the repository at this point in the history
…ver UIExpectation. Fixed broken link to pull request to the Two Toasters repository. Prepping to tag 0.9.3
  • Loading branch information
blakewatters authored and Edubits committed Aug 2, 2011
1 parent 7b30f48 commit 34c134c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
14 changes: 7 additions & 7 deletions Docs/TESTING.md
Expand Up @@ -45,11 +45,11 @@ configured and there are integration tests that test the full request/response l
1. Spec files live in sub-directories under Specs/ appropriate to the layer the code under test belongs to
1. UISpec executes Specs via categories. Adding the `UISpec` category to your spec class definition will cause it to be picked up and executed.
1. Specs begin with "it" and should be camel-cased descriptive. i.e. itShouldConsiderA200ResponseSuccessful
1. UISpec expectations are implemented via the `expectThat` macro:
1. Expectations are provided using OCHamcrest. Details of the matchers are available on the [OCHamcrest Github Page](http://jonreid.github.com/OCHamcrest/). Generally the matchers are of the form:

[expectThat([someObject someMethod]) should:be(YES)];
There is a corresponding `shouldNot` method available as well.
1. The RKSpecEnvironment.h header includes a number of helpers.
assertThat([someObject someMethod], is(equalTo(@"some value")));
There is a corresponding `isNot` method available as well.
1. The RKSpecEnvironment.h header includes a number of helpers for initializing and configuring a clean testing environment.
1. OCMock is available for mock objects support. See [http://www.mulle-kybernetik.com/software/OCMock/](http://www.mulle-kybernetik.com/software/OCMock/) for details

### Writing Integration Tests
Expand Down Expand Up @@ -101,9 +101,9 @@ Let's take a look at an example of how to use the response loader to test some f
client.password = @"INVALID";
[client get:@"/authentication/basic" delegate:loader];
[loader waitForResponse];
[expectThat([loader.response isOK]) should:be(NO)];
[expectThat([loader.response statusCode]) should:be(0)];
[expectThat([loader.failureError code]) should:be(NSURLErrorUserCancelledAuthentication)];
assertThatBool([loader.response isOK], is(equalToBool(NO)));
assertThatInt([loader.response statusCode], is(equalToInt(0)));
assertThatInt([loader.failureError code], is(equalToInt(NSURLErrorUserCancelledAuthentication)));
}

That's really all there is to it. Consult the existing test code in Specs/ for reference.
Expand Down
2 changes: 1 addition & 1 deletion Docs/WRITING_DOCS.md
Expand Up @@ -108,6 +108,6 @@ If you want to contribute documentation, the process is simple:
1. Edit the headers in Code/ and regenerate the docs via `rake docs`
1. Repeat the editing and reload cycle until your are happy.
1. Commit the code and push to Github
1. Submit a Pull Request to the Two Toasters branch on Github at: https://github.com/twotoasters/RestKit/pull/new/master
1. Submit a Pull Request to the RestKit repository on Github at: https://github.com/RestKit/RestKit/pull/new/master

You may want to coordinate your efforts via the mailing list to ensure nobody else is working on documentation in the same place.

0 comments on commit 34c134c

Please sign in to comment.