Skip to content

Commit bbbf63e

Browse files
committed
Add test for integer hash key lookup
Float will still not work :/
1 parent 56a07fe commit bbbf63e

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

spec/property_string_spec.rb

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
module Collections
66
def a_hash
7-
{:a => 123}
7+
{:a => 123, 1 => "you got an int"}
88
end
99

1010
def an_array
@@ -159,6 +159,11 @@ def baz
159159
expect(ps["foo.bar.baz"]).to eq 123
160160
end
161161

162+
it "returns the object's value for an integer key" do
163+
ps = PropertyString.new(Obj.new)
164+
expect(ps["foo.a_hash.1"]).to eq "you got an int"
165+
end
166+
162167
it "returns the object's value for an array index" do
163168
ps = PropertyString.new(Obj.new)
164169

0 commit comments

Comments
 (0)