From decbe6d0479eaeaad747cdce6a22ce00265a8aee Mon Sep 17 00:00:00 2001 From: Andrew Konchin Date: Wed, 26 Jun 2024 13:45:05 +0300 Subject: [PATCH] Reword Thread #thread_variable_get/#thread_variable_set/#thread_variable? specs titles --- core/thread/thread_variable_get_spec.rb | 7 ++++--- core/thread/thread_variable_set_spec.rb | 7 +++++-- core/thread/thread_variable_spec.rb | 7 ++++++- 3 files changed, 15 insertions(+), 6 deletions(-) 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