summaryrefslogtreecommitdiff
path: root/spec/ruby/core/gc/stress_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/ruby/core/gc/stress_spec.rb')
-rw-r--r--spec/ruby/core/gc/stress_spec.rb27
1 files changed, 27 insertions, 0 deletions
diff --git a/spec/ruby/core/gc/stress_spec.rb b/spec/ruby/core/gc/stress_spec.rb
new file mode 100644
index 0000000000..5730848895
--- /dev/null
+++ b/spec/ruby/core/gc/stress_spec.rb
@@ -0,0 +1,27 @@
+require File.expand_path('../../../spec_helper', __FILE__)
+
+describe "GC.stress" do
+ after :each do
+ # make sure that we never leave these tests in stress enabled GC!
+ GC.stress = false
+ end
+
+ it "returns current status of GC stress mode" do
+ GC.stress.should be_false
+ GC.stress = true
+ GC.stress.should be_true
+ GC.stress = false
+ GC.stress.should be_false
+ end
+end
+
+describe "GC.stress=" do
+ after :each do
+ GC.stress = false
+ end
+
+ it "sets the stress mode" do
+ GC.stress = true
+ GC.stress.should be_true
+ end
+end