only one copy of symbol  

irb(main):001:0> "string".object_id == "string".object_id
=> false
irb(main):002:0> :string.object_id == :string.object_id
=> true

The .object_id method gets the ID of an object—it’s how Ruby knows whether two objects are the exact same object.

irb(main):002:0> string = "string"
=> "string"
irb(main):003:0> string.object_id == "string".object_id
=> false
irb(main):004:0> string = :string
=> :string
irb(main):005:0> string.object_id == :string.object_id
=> true
 
0
Kudos
 
0
Kudos

Now read this

minitest setup - Ruby on Rails

I now do testing in Minitest. I came to think it’s better choice to start with minitest for testing Rails. And I thought it would make more sense when I stay out of Minitest::Spec. my-experience-with-minitest-and-rspec by tenderlove... Continue →