Inherits from NSObject
Declared in RKTestFixture.h

Overview

Provides a static method API for conveniently accessing fixture data contained within a designated NSBundle. Useful when writing unit tests that leverage fixture data for testing parsing and object mapping operations.

Tasks

  • + fixtureBundle

    Returns the NSBundle object designated as the source location for unit testing fixture data.

  • + setFixtureBundle:

    Designates the specified NSBundle object as the source location for unit testing fixture data.

  • + pathForFixture:

    Returns the full path to the specified fixture file on within the fixture bundle.

  • + stringWithContentsOfFixture:

    Creates and returns a string object by reading data from the fixture identified by the specified file name using UTF-8 encoding.

  • + dataWithContentsOfFixture:

    Creates and returns a data object by reading every byte from the fixture identified by the specified file name.

  • + MIMETypeForFixture:

    Returns the MIME Type for the fixture identified by the specified name.

  • + parsedObjectWithContentsOfFixture:

    Creates and returns an object representation of the data from the fixture identified by the specified file name by reading the data as a string and parsing it using a parser appropriate for the MIME Type of the file.

Class Methods

MIMETypeForFixture:

+ (NSString *)MIMETypeForFixture:(NSString *)fixtureName
Discussion

Returns the MIME Type for the fixture identified by the specified name.

Parameters

fixtureName

The name of the fixture file.

Return Value

The MIME Type for the resource file or nil if the file could not be located.

Declared In

RKTestFixture.h

dataWithContentsOfFixture:

+ (NSData *)dataWithContentsOfFixture:(NSString *)fixtureName
Discussion

Creates and returns a data object by reading every byte from the fixture identified by the specified file name.

Parameters

fixtureName

The name of the resource file.

Return Value

A data object by reading every byte from the fixture file.

Declared In

RKTestFixture.h

fixtureBundle

+ (NSBundle *)fixtureBundle
Discussion

Returns the NSBundle object designated as the source location for unit testing fixture data.

Return Value

The NSBundle object designated as the source location for unit testing fixture data or nil if none has been configured.

Declared In

RKTestFixture.h

parsedObjectWithContentsOfFixture:

+ (id)parsedObjectWithContentsOfFixture:(NSString *)fixtureName
Discussion

Creates and returns an object representation of the data from the fixture identified by the specified file name by reading the data as a string and parsing it using a parser appropriate for the MIME Type of the file.

Parameters

fixtureName

The name of the resource file.

Return Value

A new image object for the specified file, or nil if the method could not initialize the image from the specified file.

Declared In

RKTestFixture.h

pathForFixture:

+ (NSString *)pathForFixture:(NSString *)fixtureName
Discussion

Returns the full path to the specified fixture file on within the fixture bundle.

Parameters

fixtureName

The name of the fixture file.

Return Value

The full path to the specified fixture file or nil if it cannot be located.

Declared In

RKTestFixture.h

setFixtureBundle:

+ (void)setFixtureBundle:(NSBundle *)bundle
Discussion

Designates the specified NSBundle object as the source location for unit testing fixture data.

Parameters

bundle

The new fixture NSBundle object.

Declared In

RKTestFixture.h

stringWithContentsOfFixture:

+ (NSString *)stringWithContentsOfFixture:(NSString *)fixtureName
Discussion

Creates and returns a string object by reading data from the fixture identified by the specified file name using UTF-8 encoding.

Parameters

fixtureName

The name of the fixture file.

Return Value

A string created by reading data from the specified fixture file using the NSUTF8StringEncoding.

Declared In

RKTestFixture.h