5 #import <OCMock/OCMock.h>
6 #import <XCTest/XCTest.h>
33 XCTAssertNotNil(spawner);
34 XCTAssertNotNil(spawnee);
39 - (void)testDeleteLastEngine {
43 XCTAssertNotNil(spawner);
46 XCTAssertNotNil(spawnee);
49 - (void)testCustomEntrypoint {
53 OCMStub([group makeEngine]).andReturn(mockEngine);
54 OCMStub([mockEngine spawnWithEntrypoint:[OCMArg any]
55 libraryURI:[OCMArg any]
56 initialRoute:[OCMArg any]
57 entrypointArgs:[OCMArg any]])
61 XCTAssertNotNil(spawner);
62 OCMVerify([spawner runWithEntrypoint:
@"firstEntrypoint"
63 libraryURI:
@"firstLibraryURI"
69 XCTAssertNotNil(spawnee);
70 OCMVerify([spawner spawnWithEntrypoint:
@"secondEntrypoint"
71 libraryURI:
@"secondLibraryURI"
76 - (void)testCustomInitialRoute {
80 OCMStub([group makeEngine]).andReturn(mockEngine);
81 OCMStub([mockEngine spawnWithEntrypoint:[OCMArg any]
82 libraryURI:[OCMArg any]
83 initialRoute:[OCMArg any]
84 entrypointArgs:[OCMArg any]])
87 XCTAssertNotNil(spawner);
88 OCMVerify([spawner runWithEntrypoint:nil libraryURI:nil initialRoute:
@"foo" entrypointArgs:nil]);
91 XCTAssertNotNil(spawnee);
92 OCMVerify([spawner spawnWithEntrypoint:nil
98 - (void)testCustomEntrypointArgs {
102 OCMStub([group makeEngine]).andReturn(mockEngine);
103 OCMStub([mockEngine spawnWithEntrypoint:[OCMArg any]
104 libraryURI:[OCMArg any]
105 initialRoute:[OCMArg any]
106 entrypointArgs:[OCMArg any]])
109 NSArray* firstEntrypointArgs = @[ @"foo", @"first" ];
112 XCTAssertNotNil(spawner);
113 OCMVerify([spawner runWithEntrypoint:nil
116 entrypointArgs:firstEntrypointArgs]);
118 NSArray* secondEntrypointArgs = @[ @"bar", @"second" ];
122 XCTAssertNotNil(spawnee);
123 OCMVerify([spawner spawnWithEntrypoint:nil
126 entrypointArgs:secondEntrypointArgs]);
129 - (void)testReleasesProjectOnDealloc {
134 project:mockProject];
135 XCTAssertNotNil(group);
136 weakProject = mockProject;
137 XCTAssertNotNil(weakProject);
141 XCTAssertNil(weakProject);