-
Notifications
You must be signed in to change notification settings - Fork 283
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
Handle uncaught exceptions #171
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -83,6 +83,23 @@ module XCPretty | |
) | ||
end | ||
|
||
it "formats uncaught exceptions" do | ||
@formatter.format_uncaught_exception("testRaisingUncaughtException", | ||
'NSInvalidArgumentException', | ||
'-[__NSPlaceholderDictionary initWithObjects:forKeys:count:]: attempt to insert nil object from objects[0]', | ||
[' 0 CoreFoundation 0x0000000109479a75 __exceptionPreprocess + 165', | ||
' 1 libobjc.A.dylib 0x0000000109112bb7 objc_exception_throw + 45', | ||
' 2 CoreFoundation 0x000000010938503f -[__NSPlaceholderDictionary initWithObjects:forKeys:count:] + 383', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Line is too long. [135/80] |
||
' 3 CoreFoundation 0x0000000109397d8b +[NSDictionary dictionaryWithObjects:forKeys:count:] + 59']).should == %Q( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Any chance you could reuse the fixture here? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do you mean, reuse There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sorry, you might want to use There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That would be There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Line is too long. [142/80] |
||
#{@formatter.red("💥 testRaisingUncaughtException")} | ||
NSInvalidArgumentException: -[__NSPlaceholderDictionary initWithObjects:forKeys:count:]: attempt to insert nil object from objects[0] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Line is too long. [133/80] |
||
|
||
\t0 CoreFoundation 0x0000000109479a75 __exceptionPreprocess + 165 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Line is too long. [88/80] |
||
\t1 libobjc.A.dylib 0x0000000109112bb7 objc_exception_throw + 45 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Line is too long. [86/80] |
||
\t2 CoreFoundation 0x000000010938503f -[__NSPlaceholderDictionary initWithObjects:forKeys:count:] + 383 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Line is too long. [126/80] |
||
\t3 CoreFoundation 0x0000000109397d8b +[NSDictionary dictionaryWithObjects:forKeys:count:] + 59 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Line is too long. [118/80] |
||
) | ||
end | ||
|
||
it "formats failures per suite" do | ||
Syntax.stub(:highlight) { |snippet| snippet.contents } | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -405,6 +405,20 @@ module XCPretty | |
end | ||
end | ||
|
||
it "parses uncaught exception errors" do | ||
@formatter.should receive(:format_uncaught_exception).with( | ||
'testRaisingUncaughtException', | ||
'NSInvalidArgumentException', | ||
'-[__NSPlaceholderDictionary initWithObjects:forKeys:count:]: attempt to insert nil object from objects[0]', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Line is too long. [118/80] |
||
[' 0 CoreFoundation 0x0000000109479a75 __exceptionPreprocess + 165', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Line is too long. [101/80] |
||
' 1 libobjc.A.dylib 0x0000000109112bb7 objc_exception_throw + 45', | ||
' 2 CoreFoundation 0x000000010938503f -[__NSPlaceholderDictionary initWithObjects:forKeys:count:] + 383', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Line is too long. [139/80] |
||
' 3 CoreFoundation 0x0000000109397d8b +[NSDictionary dictionaryWithObjects:forKeys:count:] + 59']) | ||
SAMPLE_UNCAUGHT_EXCEPTION.each_line do |line| | ||
@parser.parse(line) | ||
end | ||
end | ||
|
||
it "parses code sign error:" do | ||
@formatter.should receive(:format_error).with( | ||
'Code Sign error: No code signing identites found: No valid signing identities (i.e. certificate and private key pair) matching the team ID “CAT6HF57NJ” were found.' | ||
|
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.
Align the parameters of a method call if they span more than one line.
Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.