Skip to content

Commit

Permalink
Expand specs for Thread#thread_variables
Browse files Browse the repository at this point in the history
* Test different key types

This shows the Symbol type being used as the internal type.
  • Loading branch information
herwinw committed Jan 9, 2024
1 parent 7ab86dc commit 4cd2a60
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions core/thread/thread_variables_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,12 @@
Thread.current.thread_variables.should == []
@t.thread_variables.should == []
end

it "converts keys into Symbols" do
key = mock('key')
key.should_receive(:to_str).and_return('a')
@t.thread_variable_set(key, 49)
@t.thread_variable_set('b', 50)
@t.thread_variables.sort.should == [:a, :b]
end
end

0 comments on commit 4cd2a60

Please sign in to comment.