Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

James Bell contrib

  • Loading branch information...
commit b5d52fd95b7dc30f1f9aae8c4bd656eed11033a7 1 parent 8e9c9b4
squarism authored

Showing 1 changed file with 10 additions and 1 deletion. Show diff stats Hide diff stats

  1. +10 1 about_symbols.rb
11 about_symbols.rb
@@ -44,7 +44,16 @@ def test_method_names_become_symbols
44 44 def test_constants_become_symbols
45 45 all_symbols = Symbol.all_symbols
46 46
47   - assert_equal true, all_symbols.include?(:RubyConstant)
  47 + # Thanks to James Bell for this catch!
  48 + # this always will be true, false positive
  49 + # assert_equal true, all_symbols.include?(:RubyConstant)
  50 + # The proper way is to look for the string
  51 + # assert_equal false, all_symbols.include?("thisHasNeverBeenUsedBefore")
  52 + # Or do something like this
  53 + # :thisHasBeenUsed = "foo"
  54 + # assert_equal true, all_symbols.include?("thisHasBeenUsed")
  55 + symbols = Symbol.all_symbols.map {|x| x.to_s }
  56 + assert_equal true, symbols.include?("RubyConstant")
48 57 end
49 58 end
50 59

0 comments on commit b5d52fd

Please sign in to comment.
Something went wrong with that request. Please try again.