Move Hash specs to rely less on shared examples#1367
Open
Earlopain wants to merge 1 commit into
Open
Conversation
This is mostly a mechanical translation. A few things of interest: Two shared specs weren't actually shared. `Hash#index` used to be an alias for `Hash#key` but was removed at some point. `Hash#values_at` had shared specs which never were actually shared. Tests for `Hash#[]=` used `send`. I explicitly added back a test usign `send` to assert the return value. I cleaned up requires, each test file can be run in isolation. For `../mspec/bin/mspec core/hash`: ``` Before: 69 files, 633 examples, 1176 expectations, 0 failures, 0 errors, 0 tagged After: 69 files, 558 examples, 1026 expectations, 0 failures, 0 errors, 0 tagged ``` So 75 fewer specs, 150 fewer assertions
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See #1364
This is mostly a mechanical translation. A few things of interest:
Two shared specs weren't actually shared.
Hash#indexused to be an alias forHash#keybut was removed at some point.Hash#values_athad shared specs which never were actually shared.Tests for
Hash#[]=usedsend. I explicitly added back a test usignsendto assert the return value.I cleaned up requires, each test file can be run in isolation.
For
../mspec/bin/mspec core/hash:So 75 fewer specs, 150 fewer assertions