-
-
Notifications
You must be signed in to change notification settings - Fork 390
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 argument coercion (#to_int, #to_str) in Signal #1074
Conversation
hup = Signal.list["HUP"] | ||
Signal.trap hup, @proc | ||
Signal.trap(hup, @saved_trap).should equal(@proc) | ||
end |
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.
suggestion: I would check also that Signal.list["HUP"]
returns Integer but not some other type:
hup = Signal.list["HUP"]
hup.should.is_a?(Integer)
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.
The file list_spec.rb
contains these two tests:
it "includes the EXIT key with a value of zero" do
Signal.list["EXIT"].should == 0
end
it "includes the KILL key with a value of nine" do
Signal.list["KILL"].should == 9
end
I would guess the return type is covered here.
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 may help to maintain this test case in future (and make it more readable) as for me. As a reader I may not remember what Signal.list
returns at all and explicit check just makes the value type explicit. But it's a subjective topic of course.
Could you please squash commits and I will merge the PR then? |
968d483
to
e8c660f
Compare
They're squashed into 1 commit. Only 9 more review to go, I'll try to have a look at them somewhere this week. |
Thank you! |
No description provided.