Permalink
Browse files

Clarify some test descriptions. [test]

  • Loading branch information...
1 parent b94b1cd commit 86b51634d0c1ad6158b32cf96c3ae0cbe905434e @trans trans committed Nov 11, 2011
Showing with 18 additions and 5 deletions.
  1. +18 −5 test/case_opencascade.rb
View
@@ -12,18 +12,20 @@
end
class_method :[] do
- test "initialization" do
+ test "hash" do
o = OpenCascade[:a=>1,:b=>2]
assert_equal(1, o.a)
assert_equal(2, o.b)
end
- end
-
- class_method :[] do
- test "mutli-depth lookup" do
+ test "hash in hash" do
o = OpenCascade[:a=>1,:b=>2,:c=>{:x=>9}]
assert_equal(9, o.c.x)
end
+ test "hash in hash in hash" do
+ h = {:a=>1,:x=>{:y=>{:z=>1}}}
+ c = OpenCascade[h]
+ assert_equal(1, c.x.y.z)
+ end
end
method :[] do
@@ -85,6 +87,17 @@
end
end
+ method :<< do
+ test do
+ c = OpenCascade.new
+ c << [:x,8]
+ c << [:y,9]
+
+ assert_equal(8, c.x)
+ assert_equal(9, c.y)
+ end
+ end
+
end
testcase Hash do

0 comments on commit 86b5163

Please sign in to comment.