diff --git a/core/thread/thread_variable_get_spec.rb b/core/thread/thread_variable_get_spec.rb index 2eff1686f..67017771f 100644 --- a/core/thread/thread_variable_get_spec.rb +++ b/core/thread/thread_variable_get_spec.rb @@ -23,9 +23,10 @@ Thread.current.thread_variable_get(:thread_variable_get_spec).should be_nil end - it "converts a String key into a Symbol" do - @t.thread_variable_set(:a, 49) - @t.thread_variable_get('a').should == 49 + it "accepts String and Symbol keys interchangeably" do + @t.thread_variable_set("a", 49) + @t.thread_variable_get("a").should == 49 + @t.thread_variable_get(:a).should == 49 end it "converts a key that is neither String nor Symbol with #to_str" do diff --git a/core/thread/thread_variable_set_spec.rb b/core/thread/thread_variable_set_spec.rb index f8f790dc0..c262a6614 100644 --- a/core/thread/thread_variable_set_spec.rb +++ b/core/thread/thread_variable_set_spec.rb @@ -24,9 +24,12 @@ Thread.current.thread_variable_get(:thread_variable_get_spec).should be_nil end - it "converts a String key into a Symbol" do + it "accepts String and Symbol keys interchangeably" do @t.thread_variable_set('a', 49) - @t.thread_variable_get(:a).should == 49 + @t.thread_variable_get('a').should == 49 + + @t.thread_variable_set(:a, 50) + @t.thread_variable_get('a').should == 50 end it "converts a key that is neither String nor Symbol with #to_str" do diff --git a/core/thread/thread_variable_spec.rb b/core/thread/thread_variable_spec.rb index 041c9f438..d64e6ec63 100644 --- a/core/thread/thread_variable_spec.rb +++ b/core/thread/thread_variable_spec.rb @@ -19,9 +19,14 @@ @t.thread_variable?(:a).should be_true end - it "converts a String key into a Symbol" do + it "accepts String and Symbol keys interchangeably" do + @t.thread_variable?('a').should be_false + @t.thread_variable?(:a).should be_false + @t.thread_variable_set(:a, 49) + @t.thread_variable?('a').should be_true + @t.thread_variable?(:a).should be_true end it "converts a key that is neither String nor Symbol with #to_str" do