summaryrefslogtreecommitdiff
path: root/spec/ruby/core/module/prepend_features_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/ruby/core/module/prepend_features_spec.rb')
-rw-r--r--spec/ruby/core/module/prepend_features_spec.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/spec/ruby/core/module/prepend_features_spec.rb b/spec/ruby/core/module/prepend_features_spec.rb
index 09c15c5c15..3a50f2c2a4 100644
--- a/spec/ruby/core/module/prepend_features_spec.rb
+++ b/spec/ruby/core/module/prepend_features_spec.rb
@@ -3,7 +3,7 @@ require_relative 'fixtures/classes'
describe "Module#prepend_features" do
it "is a private method" do
- Module.should have_private_instance_method(:prepend_features, true)
+ Module.private_instance_methods(false).should.include?(:prepend_features)
end
it "gets called when self is included in another module/class" do
@@ -25,7 +25,7 @@ describe "Module#prepend_features" do
it "raises an ArgumentError on a cyclic prepend" do
-> {
ModuleSpecs::CyclicPrepend.send(:prepend_features, ModuleSpecs::CyclicPrepend)
- }.should raise_error(ArgumentError)
+ }.should.raise(ArgumentError)
end
it "clears caches of the given module" do
@@ -52,13 +52,13 @@ describe "Module#prepend_features" do
describe "on Class" do
it "is undefined" do
- Class.should_not have_private_instance_method(:prepend_features, true)
+ Class.private_instance_methods(true).should_not.include?(:prepend_features)
end
it "raises a TypeError if calling after rebinded to Class" do
-> {
Module.instance_method(:prepend_features).bind(Class.new).call Module.new
- }.should raise_error(TypeError)
+ }.should.raise(TypeError)
end
end
end
octitle (setproctitle.c:143) by 0x38CC44: ruby_process_options (ruby.c:3101) by 0x234DB1: ruby_options (eval.c:117) by 0x15B92E: rb_main (main.c:40) by 0x15B92E: main (main.c:59) 2024-01-12Fix ruby_free_proctitlePeter Zhu It is undefined behaviour to free environ as it is managed by the system. This caused RUBY_FREE_AT_EXIT to double free on systems like Linux. This commit changes it to only free orig_environ, which is enough to make both Valgrind and macOS leaks tools to not detect memory leaks. 2024-01-11Free environ when RUBY_FREE_AT_EXITPeter Zhu The environ is malloc'd, so it gets reported as a memory leak. This commit adds ruby_free_proctitle which frees it during shutdown when RUBY_FREE_AT_EXIT is set. STACK OF 1 INSTANCE OF 'ROOT LEAK: <calloc in ruby_init_setproctitle>': 5 dyld 0x18b7090e0 start + 2360 4 ruby 0x10000e3a8 main + 100 main.c:58 3 ruby 0x1000b4dfc ruby_options + 180 eval.c:121 2 ruby 0x1001c5f70 ruby_process_options + 200 ruby.c:3014 1 ruby 0x10035c9fc ruby_init_setproctitle + 76 setproctitle.c:105 0 libsystem_malloc.dylib 0x18b8c7b78 _malloc_zone_calloc_instrumented_or_legacy + 100 2023-12-07Free everything at shutdownAdam Hess when the RUBY_FREE_ON_SHUTDOWN environment variable is set, manually free memory at shutdown. Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org> Co-authored-by: Peter Zhu <peter@peterzhu.ca> 2023-09-26Dump backtraces to an arbitrary stream when using libprocstatNobuyoshi Nakada 2023-08-27Remove duplicate `#include <string.h>` [ci skip]Nobuyoshi Nakada 2023-07-14Make dtoa.c buildable aloneNobuyoshi Nakada Notes: Merged: https://github.com/ruby/ruby/pull/8074 2022-07-27Adjust styles [ci skip]Nobuyoshi Nakada 2022-04-12Fix dtoa buffer overrunNobuyoshi Nakada https://hackerone.com/reports/1248108 Notes: Merged: https://github.com/ruby/ruby/pull/5794 2022-01-19[wasm] wasm/missing.{c,h}: add missing libc stubs for wasi-libcYuta Saito Notes: Merged: https://github.com/ruby/ruby/pull/5407 2021-10-27Prefer ANSI-style prototypes over old K&R-style definitionsNobuyoshi Nakada