rhyme 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/rhyme.rb +2 -2
- data/lib/rhyme/version.rb +1 -1
- data/test/test_rhyme.rb +10 -0
- metadata +1 -1
data/lib/rhyme.rb
CHANGED
@@ -30,7 +30,7 @@ module Rhyme
|
|
30
30
|
|
31
31
|
def self.translate_array_list(array_list)
|
32
32
|
array = Array.new
|
33
|
-
array_list.each { |x| array.push x }
|
33
|
+
array_list.each { |x| array.push translate(x) }
|
34
34
|
return array
|
35
35
|
end
|
36
36
|
|
@@ -42,7 +42,7 @@ module Rhyme
|
|
42
42
|
|
43
43
|
def self.translate_array(array)
|
44
44
|
array_list = java.util.ArrayList.new
|
45
|
-
array.each { |x| array_list.add x }
|
45
|
+
array.each { |x| array_list.add translate(x) }
|
46
46
|
return array_list
|
47
47
|
end
|
48
48
|
|
data/lib/rhyme/version.rb
CHANGED
data/test/test_rhyme.rb
CHANGED
@@ -51,8 +51,18 @@ describe Rhyme do
|
|
51
51
|
Rhyme.translate(java.util.ArrayList.new).class.should eql(Array.new.class)
|
52
52
|
end
|
53
53
|
|
54
|
+
it "should translate an ArrayList values" do
|
55
|
+
array = java.util.ArrayList.new
|
56
|
+
array.add java.util.HashMap.new
|
57
|
+
Rhyme.translate(array)[0].class.should eql(Hash.new.class)
|
58
|
+
end
|
59
|
+
|
54
60
|
it "should translate an Array" do
|
55
61
|
Rhyme.translate(Array.new).class.should eql(java.util.ArrayList.new.class)
|
56
62
|
end
|
57
63
|
|
64
|
+
it "should translate an Array values" do
|
65
|
+
Rhyme.translate([{}])[0].class.should eql(java.util.HashMap.new.class)
|
66
|
+
end
|
67
|
+
|
58
68
|
end
|