spec/rubocop/cops/style/hash_syntax_spec.rb in rubocop-0.10.0 vs spec/rubocop/cops/style/hash_syntax_spec.rb in rubocop-0.11.0
- old
+ new
@@ -29,11 +29,16 @@
it 'accepts hash rockets when keys have different types' do
inspect_source(hash_syntax, ['x = { :a => 0, "b" => 1 }'])
expect(hash_syntax.offences.map(&:message)).to be_empty
end
- it 'accepts hash rockets when keys special symbols in them' do
- inspect_source(hash_syntax, ['x = { :"t o" => 0, :"\xab" => 1 }'])
+ it 'accepts hash rockets when keys have whitespaces in them' do
+ inspect_source(hash_syntax, ['x = { :"t o" => 0 }'])
+ expect(hash_syntax.offences.map(&:message)).to be_empty
+ end
+
+ it 'accepts hash rockets when keys have special symbols in them' do
+ inspect_source(hash_syntax, ['x = { :"\tab" => 1 }'])
expect(hash_syntax.offences.map(&:message)).to be_empty
end
it 'accepts new syntax in a hash literal' do
inspect_source(hash_syntax, ['x = { a: 0, b: 1 }'])