Sha256: fb761102fa6306d82fd18d7ebdd94aebc36da5cd18f8094888d62aff6530515d
Contents?: true
Size: 756 Bytes
Versions: 83
Compression:
Stored size: 756 Bytes
Contents
require File.dirname(File.join(__rhoGetCurrentDir(), __FILE__)) + '/../../spec_helper' require File.dirname(File.join(__rhoGetCurrentDir(), __FILE__)) + '/fixtures/classes' describe "Thread#key?" do before :each do @th = Thread.new do Thread.current[:oliver] = "a" end @th.join end it "tests for existance of thread local variables using symbols or strings" do @th.key?(:oliver).should == true @th.key?("oliver").should == true @th.key?(:stanley).should == false @th.key?(:stanley.to_s).should == false end it "raises exceptions on the wrong type of keys" do lambda { Thread.current.key? nil }.should raise_error(TypeError) lambda { Thread.current.key? 5 }.should raise_error(ArgumentError) end end
Version data entries
83 entries across 83 versions & 1 rubygems