Skip to content

Commit

Permalink
Add more Hash specs (initialize, initialize_copy)
Browse files Browse the repository at this point in the history
  • Loading branch information
adambeynon committed Oct 29, 2013
1 parent 5dddee5 commit f44f3b3
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 0 deletions.
6 changes: 6 additions & 0 deletions spec/filters/bugs/hash.rb
Expand Up @@ -84,6 +84,12 @@

fails "Hash#invert compares new keys with eql? semantics"

fails "Hash#initialize_copy does not transfer default values"
fails "Hash#initialize_copy calls to_hash on hash subclasses"
fails "Hash#initialize_copy tries to convert the passed argument to a hash using #to_hash"
fails "Hash#initialize_copy tries to convert the passed argument to a hash using #to_hash"
fails "Hash#initialize_copy replaces the contents of self with other"

fails "Hash#keep_if raises an RuntimeError if called on a frozen instance"

fails "Hash#key? compares keys with the same #hash value via #eql?"
Expand Down
3 changes: 3 additions & 0 deletions spec/filters/unsupported/frozen.rb
Expand Up @@ -59,4 +59,7 @@
fails "Array#initialize raises a RuntimeError on frozen arrays"

fails "Hash#clear raises a RuntimeError if called on a frozen instance"
fails "Hash#initialize_copy raises a RuntimeError if called on a frozen instance that would not be modified"
fails "Hash#initialize_copy raises a RuntimeError if called on a frozen instance that is modified"
fails "Hash#initialize raises a RuntimeError if called on a frozen instance"
end
3 changes: 3 additions & 0 deletions spec/filters/unsupported/private_methods.rb
Expand Up @@ -2,6 +2,9 @@
fails "Array#initialize is private"
fails "The defined? keyword when called with a method name having a module as a receiver returns nil if the method is private"

fails "Hash#initialize_copy is private"
fails "Hash#initialize is private"

fails "Defining an 'initialize' method sets the method's visibility to private"
fails "Defining an 'initialize_copy' method sets the method's visibility to private"

Expand Down
2 changes: 2 additions & 0 deletions spec/rubyspecs
Expand Up @@ -174,6 +174,8 @@ core/hash/include_spec
core/hash/index_spec
core/hash/indexes_spec
core/hash/indices_spec
core/hash/initialize_copy_spec
core/hash/initialize_spec
core/hash/invert_spec
core/hash/keep_if_spec
core/hash/key_spec
Expand Down

0 comments on commit f44f3b3

Please sign in to comment.