aboutsummaryrefslogtreecommitdiffstats
path: root/spec/rubyspec/optional/capi/ext/hash_spec.c
diff options
context:
space:
mode:
Diffstat (limited to 'spec/rubyspec/optional/capi/ext/hash_spec.c')
-rw-r--r--spec/rubyspec/optional/capi/ext/hash_spec.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/spec/rubyspec/optional/capi/ext/hash_spec.c b/spec/rubyspec/optional/capi/ext/hash_spec.c
index ac45003844..73e7ef5c13 100644
--- a/spec/rubyspec/optional/capi/ext/hash_spec.c
+++ b/spec/rubyspec/optional/capi/ext/hash_spec.c
@@ -23,6 +23,12 @@ VALUE hash_spec_rb_hash_dup(VALUE self, VALUE hash) {
}
#endif
+#ifdef HAVE_RB_HASH_FETCH
+VALUE hash_spec_rb_hash_fetch(VALUE self, VALUE hash, VALUE key) {
+ return rb_hash_fetch(hash, key);
+}
+#endif
+
#ifdef HAVE_RB_HASH_FREEZE
VALUE hash_spec_rb_hash_freeze(VALUE self, VALUE hash) {
return rb_hash_freeze(hash);
@@ -175,6 +181,10 @@ void Init_hash_spec(void) {
rb_define_method(cls, "rb_hash_delete_if", hash_spec_rb_hash_delete_if, 1);
#endif
+#ifdef HAVE_RB_HASH_FETCH
+ rb_define_method(cls, "rb_hash_fetch", hash_spec_rb_hash_fetch, 2);
+#endif
+
#ifdef HAVE_RB_HASH_FOREACH
rb_define_method(cls, "rb_hash_foreach", hash_spec_rb_hash_foreach, 1);
rb_define_method(cls, "rb_hash_foreach_stop", hash_spec_rb_hash_foreach_stop, 1);