Skip to content

Commit

Permalink
+ Added clarification about the use of thread local variables in expe…
Browse files Browse the repository at this point in the history
…ctations. (jemc)

[git-p4: depot-paths = "//src/minitest/dev/": change = 8893]
  • Loading branch information
zenspider committed Aug 14, 2013
1 parent ccba6a7 commit f286313
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions lib/minitest/expectations.rb
@@ -1,5 +1,18 @@
##
# It's where you hide your "assertions".
#
# Please note, because of the way that expectations are implemented,
# all expectations (eg must_equal) are dependent upon a thread local
# variable +:current_spec+. If your specs rely on mixing threads into
# the specs themselves, you're better off using assertions. For
# example:
#
# it "should still work in threads" do
# my_threaded_thingy do
# (1+1).must_equal 2 # bad
# assert_equal 2, 1+1 # good
# end
# end

module Minitest::Expectations
##
Expand Down

0 comments on commit f286313

Please sign in to comment.