-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
@dblock => allow specta extras, and a simpler image folder setting #5
Conversation
NSString *referenceImagesDirectory = [NSString stringWithFormat:@"%s", FB_REFERENCE_IMAGE_DIR]; | ||
[[EXPExpectFBSnapshotTest instance] setReferenceImagesDirectory:referenceImagesDirectory]; | ||
}); | ||
setReferenceImageDir(FB_REFERENCE_IMAGE_DIR); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should I be worried that this is something global? Should this be called something like setSnapshotTestsReferenceImageDir
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this makes sense to me.
I made a bunch of semi-cosmetic comments, mostly about documentation. Update/fix the ones you want, I'll merge. |
#import "SpectaUtility.h" | ||
#import "SPTExample.h" | ||
|
||
NSString *sanitizedTestPath(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, does this have to be pre-declared like this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes
I've pushed the changes. |
@orta, you sure you pushed any changes? Don't see any updates... |
oops, nope, have now.
|
### App setup | ||
|
||
* Specify the location of reference images with `setGlobalReferenceImageDir(FB_REFERENCE_IMAGE_DIR);` | ||
* This is a global and needs to only be set once, as the test suite is ran alphabetically, you should ensure it's in the the first test suite that loads. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still think that this method is just weird and flaky. I'll play with this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree.
Merging, thx. |
@dblock => allow specta extras, and a simpler image folder setting
In reference to #1 I've simplified the API for setting the images directory to a c function that feels a lot like the rest of spectra. So you do
setReferenceImageDir("blah")
like expected, and the docs now state that this only has to be done once.In reference to #2 I've extended the API for expecta if we see that you've included Specta in CocoaPods, this is a weak dependency because expecta is built to work without Specta, and so should our library. If you don't have it installed it will always fail.
This means we offer: