bridge 0.0.18 → 0.0.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/VERSION +1 -1
- data/bridge.gemspec +1 -1
- data/lib/bridge/deal.rb +2 -1
- data/test/test_deal.rb +5 -0
- metadata +2 -2
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.19
|
data/bridge.gemspec
CHANGED
data/lib/bridge/deal.rb
CHANGED
@@ -112,7 +112,8 @@ module Bridge
|
|
112
112
|
|
113
113
|
# Returns hash with hands
|
114
114
|
def to_hash
|
115
|
-
|
115
|
+
# use map to be 1.8.6 compatible
|
116
|
+
{ "N" => n.map{ |c| c.to_s }, "E" => e.map{ |c| c.to_s }, "S" => s.map{ |c| c.to_s }, "W" => w.map{ |c| c.to_s } }
|
116
117
|
end
|
117
118
|
|
118
119
|
def inspect
|
data/test/test_deal.rb
CHANGED
@@ -125,4 +125,9 @@ class TestDeal < Test::Unit::TestCase
|
|
125
125
|
deal = Bridge::Deal.from_id(0)
|
126
126
|
assert_equal Hash, deal.to_hash.class
|
127
127
|
end
|
128
|
+
|
129
|
+
test "to_hash returns hash with arrays of strings" do
|
130
|
+
deal = Bridge::Deal.from_id(0)
|
131
|
+
assert_equal String, deal.to_hash["N"].first.class
|
132
|
+
end
|
128
133
|
end
|