public
Description: Ruby WDDX gem.
Homepage: http://code.juretta.com/ruby/wddx/
Clone URL: git://github.com/juretta/wddx.git
Search Repo:
WDDX test cases working using Ruby 1.9
juretta (author)
Wed Apr 30 19:19:42 -0700 2008
commit  24a10605320d22502a1358298f621d59b5c1279c
tree    a775a388bb1441238010e844b38496f373ea421f
parent  6f7c9c97f1efd2befc56bfa7237c8871756b7dee
...
75
76
77
78
 
 
79
80
 
 
81
82
83
...
75
76
77
 
78
79
80
 
81
82
83
84
85
0
@@ -75,9 +75,11 @@
0
      assert binary.kind_of?(WDDX::Binary)
0
      assert_equal "MIIBJASHETAS", binary.encode
0
   end
0
-
0
+
0
+ # File handling is different in Ruby 1.9 - use "rb:ascii-8bit" for 1.9
0
   def test_binary
0
- bin_file_content = File.open("#{FIXTURES}/favicon.ico", "rb").read
0
+ mode = is19? ? "rb:ascii-8bit" : "rb"
0
+ bin_file_content = File.open("#{FIXTURES}/favicon.ico", mode).read
0
     c = WDDX.load(WDDX::Binary.new(bin_file_content).to_wddx)
0
     assert_equal bin_file_content, c.data.bin_data
0
   end
...
15
16
17
18
 
19
20
21
...
15
16
17
 
18
19
20
21
0
@@ -15,7 +15,7 @@
0
   end
0
   
0
   def to_wddx_properties
0
- [:to_s, "@name"]
0
+ ["@name", :to_s]
0
   end
0
 end
0
 
...
3
4
5
 
 
 
 
6
7
8
...
3
4
5
6
7
8
9
10
11
12
0
@@ -3,6 +3,10 @@
0
 require File.dirname(__FILE__) + '/../lib/wddx'
0
 FIXTURES = File.dirname(__FILE__) + "/fixtures"
0
 
0
+def is19?
0
+ RUBY_VERSION >= "1.9.0"
0
+end
0
+
0
 def read_fixture(f)
0
   File.read(File.join(FIXTURES, f)).gsub(/\t|\n/, "").gsub(/^(.*)<wddx/, "<wddx").gsub(/"/, "'")
0
 end

Comments

    No one has commented yet.