spec/wref_spec.rb in wref-0.0.3 vs spec/wref_spec.rb in wref-0.0.4
- old
+ new
@@ -26,15 +26,18 @@
str = nil
#Test each-method.
count = 0
str_col = ""
- map.each do |a_str|
+ key_col = ""
+ map.each do |key, a_str|
count += 1
str_col << a_str
+ key_col << key.to_s
end
+ raise "Expected key-collection to be '56' but it wasnt: #{key_col}" if key_col != "56"
raise "Expected collection to be 'Testtrala' but it wasnt: #{str_col}" if str_col != "Testtrala"
raise "Expected count 2 but it wasnt: #{count}" if count != 2
#Make the engine work a little to force garbage collection.
0.upto(10) do
@@ -48,10 +51,10 @@
GC.start
end
#Test each-method.
count = 0
- map.each do |a_str|
+ map.each do |key, a_str|
count += 1
end
raise "Expected count 0 but it wasnt: #{count}" if count != 0
raise "Should have been garbage collected but wasnt." if map.valid?(5)
\ No newline at end of file