summaryrefslogtreecommitdiff
path: root/spec/ruby/core/hash/fixtures
diff options
context:
space:
mode:
Diffstat (limited to 'spec/ruby/core/hash/fixtures')
-rw-r--r--spec/ruby/core/hash/fixtures/classes.rb7
-rw-r--r--spec/ruby/core/hash/fixtures/name.rb30
2 files changed, 37 insertions, 0 deletions
diff --git a/spec/ruby/core/hash/fixtures/classes.rb b/spec/ruby/core/hash/fixtures/classes.rb
index 3d3df576cf..ae907aaff6 100644
--- a/spec/ruby/core/hash/fixtures/classes.rb
+++ b/spec/ruby/core/hash/fixtures/classes.rb
@@ -17,6 +17,13 @@ module HashSpecs
end
end
+ class SubHashSettingInInitialize < Hash
+ def initialize(*args, &block)
+ self[:foo] = :bar
+ super(*args, &block)
+ end
+ end
+
class DefaultHash < Hash
def default(key)
100
diff --git a/spec/ruby/core/hash/fixtures/name.rb b/spec/ruby/core/hash/fixtures/name.rb
new file mode 100644
index 0000000000..b203bf6ae4
--- /dev/null
+++ b/spec/ruby/core/hash/fixtures/name.rb
@@ -0,0 +1,30 @@
+class TrueClass
+ def hash
+ raise "TrueClass#hash should not be called"
+ end
+end
+class FalseClass
+ def hash
+ raise "FalseClass#hash should not be called"
+ end
+end
+class Integer
+ def hash
+ raise "Integer#hash should not be called"
+ end
+end
+class Float
+ def hash
+ raise "Float#hash should not be called"
+ end
+end
+class String
+ def hash
+ raise "String#hash should not be called"
+ end
+end
+class Symbol
+ def hash
+ raise "Symbol#hash should not be called"
+ end
+end