-
-
Notifications
You must be signed in to change notification settings - Fork 388
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
Add specs for Exception#detailed_message
#1029
Add specs for Exception#detailed_message
#1029
Conversation
I'm not sure if thats enough. Adding more cases with different errors messages (like what I wrote) imo is not necessary, but maybe an example of creating new error class, with custom |
I would propose the following test cases:
Also the behaviour of
Original PR with some MRI specs - ruby/ruby#5516 |
0cff35c
to
efae009
Compare
6b7718d
to
4b01b08
Compare
@@ -93,3 +93,7 @@ def call_undefined_class_variable | |||
end | |||
end | |||
end | |||
|
|||
module DetailedMessageSpec | |||
C = Class.new(RuntimeError) |
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.
Is C
enough, or should it be more meaningful?
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.
Yeap, it's OK. There are a lot of helper classes like A
, B
, M
etc with short names for readability (I suppose)
RuntimeError.new("new error").detailed_message(highlight: true).should == "\e[1mnew error (\e[1;4mRuntimeError\e[m\e[1m)\e[m" | ||
end | ||
|
||
it "allows and ingores other keyword arguments" do |
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.
it "allows and ingores other keyword arguments" do | |
it "allows and ignores other keyword arguments" do |
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.
Ehh.. these typos everywhere.. sorry
4b01b08
to
98e6283
Compare
Thank you for new specs! |
#1016
[Feature #18564]