Permalink
Browse files

improve tests for DynamicKeyHash

  • Loading branch information...
1 parent 7cd6a80 commit 7fb6d35b01979b1701b792796ff2ec09d87132bc @bakkdoor committed Dec 10, 2012
Showing with 22 additions and 1 deletion.
  1. +22 −1 tests/dynamic_key_hash.fy
View
@@ -5,12 +5,33 @@ FancySpec describe: DynamicKeyHash with: {
name: "Chris"
age: 25
country: "Germany"
+ nested: { yo: "off" }
}
hash = dkh hash
- Set[hash keys] is: $ Set[['name, 'age, 'country]]
+ Set[hash keys] is: $ Set[['name, 'age, 'country, 'nested]]
hash['name] is: "Chris"
hash['age] is: 25
hash['country] is: "Germany"
+ hash['nested] is_a?: Block . is: true
+ }
+
+ it: "returns a deeply nested hash correctly" when: {
+ dkh = DynamicKeyHash new: true
+ dkh tap: @{
+ foo: @{
+ bar: @{
+ baz: "yo"
+ }
+ }
+ }
+
+ dkh hash is: <[
+ 'foo => <[
+ 'bar => <[
+ 'baz => "yo"
+ ]>
+ ]>
+ ]>
}
}

0 comments on commit 7fb6d35

Please sign in to comment.