rhyme 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/test/test_rhyme.rb +29 -0
- metadata +64 -0
data/test/test_rhyme.rb
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
require File.dirname(__FILE__) + '/../lib/rhyme'
|
2
|
+
|
3
|
+
require "date"
|
4
|
+
require "java"
|
5
|
+
|
6
|
+
describe Rhyme do
|
7
|
+
|
8
|
+
it "should translate a Map" do
|
9
|
+
Rhyme.translate(java.util.HashMap.new).class.should eql(Hash.new.class)
|
10
|
+
end
|
11
|
+
|
12
|
+
it "should translates map values" do
|
13
|
+
jmap = java.util.HashMap.new
|
14
|
+
jmap.put "key1", "value"
|
15
|
+
jmap.put "key2", java.util.Date.new(1234567890)
|
16
|
+
rmap = Rhyme.translate(jmap)
|
17
|
+
rmap["key1"].should eql("value")
|
18
|
+
rmap["key2"].to_s.should eql("2009-02-13")
|
19
|
+
end
|
20
|
+
|
21
|
+
it "should translate a Date" do
|
22
|
+
Rhyme.translate(java.util.Date.new(1234567890)).to_s.should eql("2009-02-13")
|
23
|
+
end
|
24
|
+
|
25
|
+
it "should translate an ArrayList" do
|
26
|
+
Rhyme.translate(java.util.ArrayList.new).class.should eql(Array.new.class)
|
27
|
+
end
|
28
|
+
|
29
|
+
end
|
metadata
ADDED
@@ -0,0 +1,64 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: rhyme
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Diego Carrion
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
|
12
|
+
date: 2008-09-25 00:00:00 -03:00
|
13
|
+
default_executable:
|
14
|
+
dependencies:
|
15
|
+
- !ruby/object:Gem::Dependency
|
16
|
+
name: hoe
|
17
|
+
type: :development
|
18
|
+
version_requirement:
|
19
|
+
version_requirements: !ruby/object:Gem::Requirement
|
20
|
+
requirements:
|
21
|
+
- - ">="
|
22
|
+
- !ruby/object:Gem::Version
|
23
|
+
version: 1.7.0
|
24
|
+
version:
|
25
|
+
description: description of gem
|
26
|
+
email:
|
27
|
+
- dc.rec1@gmail.com
|
28
|
+
executables: []
|
29
|
+
|
30
|
+
extensions: []
|
31
|
+
|
32
|
+
extra_rdoc_files: []
|
33
|
+
|
34
|
+
files: []
|
35
|
+
|
36
|
+
has_rdoc: true
|
37
|
+
homepage: http://rhyme.rubyforge.org
|
38
|
+
post_install_message: ""
|
39
|
+
rdoc_options:
|
40
|
+
- --main
|
41
|
+
- README.txt
|
42
|
+
require_paths:
|
43
|
+
- lib
|
44
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
45
|
+
requirements:
|
46
|
+
- - ">="
|
47
|
+
- !ruby/object:Gem::Version
|
48
|
+
version: "0"
|
49
|
+
version:
|
50
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: "0"
|
55
|
+
version:
|
56
|
+
requirements: []
|
57
|
+
|
58
|
+
rubyforge_project: rhyme
|
59
|
+
rubygems_version: 1.2.0
|
60
|
+
signing_key:
|
61
|
+
specification_version: 2
|
62
|
+
summary: description of gem
|
63
|
+
test_files:
|
64
|
+
- test/test_rhyme.rb
|