aboutsummaryrefslogtreecommitdiffstats
path: root/spec/ruby/core/thread/current_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/ruby/core/thread/current_spec.rb')
-rw-r--r--spec/ruby/core/thread/current_spec.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/spec/ruby/core/thread/current_spec.rb b/spec/ruby/core/thread/current_spec.rb
new file mode 100644
index 0000000000..cc969b71c4
--- /dev/null
+++ b/spec/ruby/core/thread/current_spec.rb
@@ -0,0 +1,15 @@
+require File.expand_path('../../../spec_helper', __FILE__)
+require File.expand_path('../fixtures/classes', __FILE__)
+
+describe "Thread.current" do
+ it "returns a thread" do
+ current = Thread.current
+ current.should be_kind_of(Thread)
+ end
+
+ it "returns the current thread" do
+ t = Thread.new { Thread.current }
+ t.value.should equal(t)
+ Thread.current.should_not equal(t.value)
+ end
+end