Skip to content

Commit f31d877

Browse files
authored
Test exercise GHA (#336)
[no important files changed]
1 parent 5e4f506 commit f31d877

5 files changed

Lines changed: 171 additions & 243 deletions

File tree

.github/workflows/test.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: Test Exercises
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
test:
7+
runs-on: macos-15
8+
9+
steps:
10+
- name: Checkout code
11+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
12+
13+
- name: Test Exercises
14+
run: |
15+
set -o pipefail
16+
xcodebuild test \
17+
-project xcodeProject/ObjectiveC.xcodeproj \
18+
-scheme xobjectivecTest \
19+
-destination 'platform=macOS' \
20+
| xcpretty

.travis.yml

Lines changed: 0 additions & 22 deletions
This file was deleted.

Dangerfile

Lines changed: 0 additions & 51 deletions
This file was deleted.

exercises/practice/hello-world/HelloWorldTest.m

Lines changed: 4 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -14,29 +14,10 @@ @interface HelloWorldTest : XCTestCase
1414

1515
@implementation HelloWorldTest
1616

17-
- (HelloWorld *)helloWorld {
18-
return [[HelloWorld alloc] init];
19-
}
20-
21-
- (void)testNoName {
22-
NSString *input = nil;
23-
NSString *expected = @"Hello, World!";
24-
NSString *result = [[self helloWorld] hello:input];
25-
XCTAssertEqualObjects(expected, result);
26-
}
27-
28-
- (void)testSampleName {
29-
NSString *input = @"Alice";
30-
NSString *expected = @"Hello, Alice!";
31-
NSString *result = [[self helloWorld] hello:input];
32-
XCTAssertEqualObjects(expected, result);
33-
}
34-
35-
- (void)testOtherSampleName {
36-
NSString *input = @"Bob";
37-
NSString *expected = @"Hello, Bob!";
38-
NSString *result = [[self helloWorld] hello:input];
39-
XCTAssertEqualObjects(expected, result);
17+
- (void)testHello {
18+
NSString *expected = @"Hello, World!";
19+
NSString *result = [[[HelloWorld alloc] init] hello];
20+
XCTAssertEqualObjects(expected, result);
4021
}
4122

4223
@end

0 commit comments

Comments
 (0)