From e13801c764782c979be595c24968e377ea6338f6 Mon Sep 17 00:00:00 2001 From: Torsten Ruger Date: Mon, 18 Aug 2014 17:19:34 +0300 Subject: [PATCH] moving (back) to 1.9 style hash, clearer that it is an association. didnt like the double colon --- lib/sof/hash.rb | 2 +- test/sof.rb | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/sof/hash.rb b/lib/sof/hash.rb index 93b2c58e..04fbcb0d 100644 --- a/lib/sof/hash.rb +++ b/lib/sof/hash.rb @@ -16,7 +16,7 @@ module Sof io.write "\n#{indent}" unless i == 0 io.write "-" key.out(io , level + 1) - io.write ": " + io.write " => " val.out(io , level + 1) end end diff --git a/test/sof.rb b/test/sof.rb index fe9fcde4..30632626 100644 --- a/test/sof.rb +++ b/test/sof.rb @@ -60,19 +60,19 @@ class BasicSof < MiniTest::Test end def test_simple_hash @out = Sof::Writer.write({ one: 1 , tru: true }) - check "-:one: 1\n-:tru: true" + check "-:one => 1\n-:tru => true" end def test_hash_object @out = Sof::Writer.write({ one: 1 , two: ObjectWithAttributes.new }) - check "-:one: 1\n-:two: #{OBJECT_STRING}" + check "-:one => 1\n-:two => #{OBJECT_STRING}" end def test_array_hash @out = Sof::Writer.write([true, 1 , { one: 1 , tru: true }]) - check "-true\n-1\n--:one: 1\n -:tru: true" + check "-true\n-1\n--:one => 1\n -:tru => true" end def test_hash_array @out = Sof::Writer.write({ one: [1 , ObjectWithAttributes.new] , two: true }) - check "-:one: -1\n -#{OBJECT_STRING}\n-:two: true" + check "-:one => -1\n -#{OBJECT_STRING}\n-:two => true" end def test_array_recursive ar = [true, 1 ]