Skip to content

Conversation

@cadwallion
Copy link
Contributor

Part of #565, this implements Feature 12063: KeyError#receiver / KeyError#key from Ruby 2.5.0 release.

Andrew Nordman added 3 commits December 28, 2017 14:52
Copy link
Member

@eregon eregon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great :)

@key = :a
end

it "sets the Hash as the reciever of KeyError" do
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

receiver

}
end

it "sets the key attempted as key of KeyError" do
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sets the not-found key is maybe a bit clearer.

@cadwallion
Copy link
Contributor Author

Updated per review. 😄

Copy link
Member

@eregon eregon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the new specs!

@eregon eregon merged commit 05b4597 into ruby:master Dec 30, 2017
@eregon
Copy link
Member

eregon commented Dec 30, 2017

I am thinking we might be able to used shared specs, and pass a lambda which triggers the KeyError.
But unfortunately shared specs are not well documented (#575), although there are plenty of examples in other specs.
@cadwallion Would you like to try it?

@cadwallion
Copy link
Contributor Author

Sure, makes sense. I'll give it a go!

@cadwallion cadwallion deleted the key_error branch December 31, 2017 01:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants