From: aufi.cz@... Date: 2015-12-10T15:26:40+00:00 Subject: [ruby-core:72032] [Ruby trunk - Bug #11802] [Open] Hash.new and {} have different behaviour Issue #11802 has been reported by Marek Aufart. ---------------------------------------- Bug #11802: Hash.new and {} have different behaviour https://bugs.ruby-lang.org/issues/11802 * Author: Marek Aufart * Status: Open * 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/