Skip to content

Commit 5b1f519

Browse files
committed
Deprecate new_hash and hash_class.
1 parent 46f800d commit 5b1f519

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lib/mspec/helpers/hash.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,20 @@
1+
require 'mspec/utils/deprecate'
2+
13
class Object
24
# The following helpers provide a level of indirection for running the specs
35
# against a Hash implementation that has a different name than Hash.
46

57
# Returns the Hash class.
68
unless method_defined?(:hash_class)
79
def hash_class
10+
MSpec.deprecate "hash_class", "Hash"
811
Hash
912
end
1013
end
1114

1215
# Returns a new instance of hash_class.
1316
def new_hash(*args, &block)
17+
MSpec.deprecate "new_hash", "hash literals"
1418
if block
1519
hash_class.new(&block)
1620
elsif args.size == 1

0 commit comments

Comments
 (0)