Questions tagged [gh-unit]

GHUnit is a test framework for Objective-C, Mac OS X 10.5 and above and iPhone 3.x and above. It can be used standalone or with other testing frameworks like SenTestingKit or GTM.

GHUnit is a test framework for Objective-C, Mac OS X 10.5 and above and iPhone 3.x and above. It can be used standalone or with other testing frameworks like SenTestingKit or GTM.

62 questions
1
vote
1 answer

Have an iOS Simulator libSystem issue to run GH-Unit at command line

Thank you for seeing this question. I wrote unit tests with GHUnit. Now I am trying build tests on terminal to connect with Travis CI, and facing a problem. I basically…
1
vote
2 answers

GH-Unit and "Undefined symbols" error

I'm using GH-Unit for my unit tests. I've set it up according to the instructions, but I'm getting an "Undefined Symbol" error on this line: #import "GHUnit.h" #import "ChecklistAppDelegate.h" @interface TestAppDelegate : GHTestCase…
kubi
  • 48,104
  • 19
  • 94
  • 118
1
vote
1 answer

cmd-line tests fail with SSL certificate error

After encountering a bunch of problems related to coverage flushing (fixed) and test output being consumed (not fixed), I decided to give Cedar and GH-Unit a try as an alternative to XCTest. Unfortunately this presents a new problem: When…
Jasper Blues
  • 28,258
  • 22
  • 102
  • 185
1
vote
0 answers

Converting GHUnitTests to XCTest - replacement for GHTestLog

I'm converting a project to the XCTest framework, and am trying to find a good replacement for GHTestLog. I could easily change them to XCTAssert(NO, @"..."); but this doesn't seem that elegant, because GHTestLog was never making an assertion. Is…
stevethomp
  • 106
  • 6
1
vote
2 answers

Unit testing IBOutlet's properties

I use GHUnit. I want to test IBOutlet's properties such as isHidden, delegate, etc. I tried below code to test if myView is hidden : - (void)testViewDidLoad { // Call view on viewcontroller which will load the view if not loaded [testClass…
Geek
  • 8,280
  • 17
  • 73
  • 137
1
vote
1 answer

Testing for presentedViewController with GHUnit

After tapping a button, a UIImagePickerController gets displayed as a modal view controller with the following code: UIImagePickerController *imagePicker = [[UIImagePickerController alloc] init]; imagePicker.sourceType =…
Daren
  • 787
  • 2
  • 7
  • 18
1
vote
1 answer

OCMock failure mocking 'initWithAttributedString' on NSMutableAttributedString

I'm trying to understand what is mockable and what isn't. In an experiment with an NSMutableAttributedString, I don't appear to be able to mock initWithAttributedString. - (void)test_mutableString_shouldWorkAsAMutableString { …
Dr Joe
  • 718
  • 5
  • 19
1
vote
3 answers

Unexpected crash using OCMock, mocking 'mutableCopy' on an NSString

I'm trying to mock a call to mutableCopy using OCMock and GHUnit on iOS. Despite the test passing, I get an EXC_BAD_ACCESS exception during the cleanup, and I'm trying to work out why. Take a look at this. This test shows that it is possible to mock…
Dr Joe
  • 718
  • 5
  • 19
1
vote
1 answer

GHUnit access private variable

I'm trying to access a private class variable in my unit test: Class - private variable abc; unit test category/extension above the unittest m file content @property (...) variable abc; but within the test, I always get a unrecognized selector…
matttrakker
  • 204
  • 3
  • 15
1
vote
2 answers

GHUnit : Testing Magical Record Code

I would like to test my repositories that use MagicalRecord framework. I'm doing the following (from this article : http://www.cimgf.com/2012/05/15/unit-testing-with-core-data/ ) : @interface OMSTests : GHTestCase @end @implementation OMSTests -…
Nicolas Henin
  • 3,244
  • 2
  • 21
  • 42
1
vote
4 answers

'GHUnitIOS/GHUnit.h' file not found in Xcode

Hello this is the error that I got I am trying to use ASIHTTPRequest API. I have Xcode 4.5.2 with IOS 6.0 simulators. I've tried to search this file on my mac but actually the file does not exist in my entire hard drive! Any plausible way to fix…
Sarp Kaya
  • 3,686
  • 21
  • 64
  • 103
0
votes
1 answer

iPhone Simulator: App/Documents disappear

Is it standard that a XCode-Build empties the documents folder of the app on iphone simulator? How can I prevent that?
cschuff
  • 5,502
  • 7
  • 36
  • 52
0
votes
1 answer

iOS Unit Tests: simulate Home Button press etc

is it possible to simulate pressing Home Button to terminate app in the automated tests? Is it possible to simulate switching to AirPlane Mode? I am using GHUnit and I want to test these scenarios: Press Home button during file download and wake…
Martin Pilch
  • 3,245
  • 3
  • 38
  • 61
0
votes
1 answer

How can I use UIApplicationDelegate in command line GHUnit?

I have differences about GHUnit results between run from simulator and run from command line. How can I use UIApplicationDelegate in cli? In my sample app - tags stackoverflow-6479906. I want to transfer apple's OCUnit example to GHUnit…
Matt - sanemat
  • 5,418
  • 8
  • 37
  • 41
0
votes
4 answers

Is it even possible for one iOS app to access another app's Caches directory?

I'm writing a unit test with GHUnit. I would like to check if a file is being generated in the Caches directory within the Library directory of another app. Is this feasible, or are apps prevented from accessing each others' Library directories? And…
Apophenia Overload
  • 2,485
  • 3
  • 28
  • 46