From: ruby-core@... Date: 2015-12-10T19:08:25+00:00 Subject: [ruby-core:72039] [Ruby trunk - Bug #11802] [Rejected] Hash.new and {} have different behaviour Issue #11802 has been updated by Marc-Andre Lafortune. Status changed from Open to Rejected ---------------------------------------- Bug #11802: Hash.new and {} have different behaviour https://bugs.ruby-lang.org/issues/11802#change-55451 * Author: Marek Aufart * Status: Rejected * Priority: Normal * Assignee: * ruby -v: ruby 2.2.3p173 (2015-08-18 revision 51636) [x86_64-linux] * Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN ---------------------------------------- It looks that {} is not recognized as a variable sometimes. irb(main):001:0> p Hash.new {} => {} irb(main):002:0> p {} => nil Similar in rspec test: expect(subject.something).to eq {} # fails on not given argument for eq expect(subject.something).to eq({}) # works -- https://bugs.ruby-lang.org/