rhyme 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/test/test_rhyme.rb +32 -3
  2. metadata +2 -2
@@ -9,21 +9,50 @@ describe Rhyme do
9
9
  Rhyme.translate(java.util.HashMap.new).class.should eql(Hash.new.class)
10
10
  end
11
11
 
12
+ it "should translate a Hash" do
13
+ Rhyme.translate(Hash.new).class.should eql(java.util.HashMap.new.class)
14
+ end
15
+
12
16
  it "should translates map values" do
13
17
  jmap = java.util.HashMap.new
14
18
  jmap.put "key1", "value"
15
19
  jmap.put "key2", java.util.Date.new(1234567890)
16
20
  rmap = Rhyme.translate(jmap)
17
21
  rmap["key1"].should eql("value")
18
- rmap["key2"].to_s.should eql("2009-02-13")
22
+ rmap["key2"].to_s.should eql("1970-01-15")
23
+ end
24
+
25
+ it "should translates hash values" do
26
+ rmap = Hash.new
27
+ rmap["key1"] = "value"
28
+ rmap["key2"] = Date.new(2009, 2, 13)
29
+ jmap = Rhyme.translate(rmap)
30
+ jmap.get("key1").should eql("value")
31
+ jmap.get("key2").to_string.should eql("Fri Feb 13 00:00:00 BRST 2009")
32
+ end
33
+
34
+ it "should translate a Java Date value" do
35
+ Rhyme.translate(java.util.Date.new(1234567890)).to_s.should eql("1970-01-15")
19
36
  end
20
37
 
21
- it "should translate a Date" do
22
- Rhyme.translate(java.util.Date.new(1234567890)).to_s.should eql("2009-02-13")
38
+ it "should translate a Java Date" do
39
+ Rhyme.translate(java.util.Date.new(1234567890)).class.should eql(Date.new.class)
40
+ end
41
+
42
+ it "should translate a Ruby Date value" do
43
+ Rhyme.translate(Date.new(2009, 2, 13)).to_s.should eql("Fri Feb 13 00:00:00 BRST 2009")
44
+ end
45
+
46
+ it "should translate a Ruby Date" do
47
+ Rhyme.translate(Date.new(2009, 2, 13)).class.should eql(java.util.Date.new(1234567890).class)
23
48
  end
24
49
 
25
50
  it "should translate an ArrayList" do
26
51
  Rhyme.translate(java.util.ArrayList.new).class.should eql(Array.new.class)
27
52
  end
28
53
 
54
+ it "should translate an Array" do
55
+ Rhyme.translate(Array.new).class.should eql(java.util.ArrayList.new.class)
56
+ end
57
+
29
58
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rhyme
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Diego Carrion
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2008-09-26 00:00:00 -03:00
12
+ date: 2008-09-27 00:00:00 -03:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency