Changeset 1015
- Timestamp:
- 10/19/03 00:09:45 (5 years ago)
- Files:
-
- trunk/test/soap/marshal/test_marshal.rb (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/test/soap/marshal/test_marshal.rb
r1013 r1015 8 8 9 9 module MarshalTestLib 10 11 module Mod1; end 12 module Mod2; end 13 10 14 def encode(o) 11 15 SOAPMarshal.dump(o) … … 52 56 end 53 57 58 def test_object_extend 59 o1 = Object.new 60 o1.extend(Mod1) 61 marshal_equal(o1) { |o| 62 (class << self; self; end).ancestors 63 } 64 o1.extend(Mod2) 65 marshal_equal(o1) { |o| 66 (class << self; self; end).ancestors 67 } 68 end 69 70 def test_object_subclass_extend 71 o1 = MyObject.new(2) 72 o1.extend(Mod1) 73 marshal_equal(o1) { |o| 74 (class << self; self; end).ancestors 75 } 76 o1.extend(Mod2) 77 marshal_equal(o1) { |o| 78 (class << self; self; end).ancestors 79 } 80 end 81 54 82 class MyArray < Array; def initialize(v, *args) super args; @v = v; end end 55 83 def test_array … … 106 134 o1.instance_eval { @iv = 1 } 107 135 marshal_equal(o1) {|o| o.instance_eval { @iv }} 136 end 137 138 def test_hash_extend 139 o1 = Hash.new 140 o1.extend(Mod1) 141 marshal_equal(o1) { |o| 142 (class << self; self; end).ancestors 143 } 144 o1.extend(Mod2) 145 marshal_equal(o1) { |o| 146 (class << self; self; end).ancestors 147 } 148 end 149 150 def test_hash_subclass_extend 151 o1 = MyHash.new(2) 152 o1.extend(Mod1) 153 marshal_equal(o1) { |o| 154 (class << self; self; end).ancestors 155 } 156 o1.extend(Mod2) 157 marshal_equal(o1) { |o| 158 (class << self; self; end).ancestors 159 } 108 160 end 109 161 … … 142 194 end 143 195 196 def test_float_extend 197 o1 = 0.0/0.0 198 o1.extend(Mod1) 199 marshal_equal(o1) { |o| 200 (class << self; self; end).ancestors 201 } 202 o1.extend(Mod2) 203 marshal_equal(o1) { |o| 204 (class << self; self; end).ancestors 205 } 206 end 207 144 208 class MyRange < Range; def initialize(v, *args) super(*args); @v = v; end end 145 209 def test_range … … 210 274 o1.instance_eval { @iv = 1 } 211 275 marshal_equal(o1) {|o| o.instance_eval { @iv }} 276 end 277 278 def test_struct_subclass_extend 279 o1 = MyStruct.new 280 o1.extend(Mod1) 281 marshal_equal(o1) { |o| 282 (class << self; self; end).ancestors 283 } 284 o1.extend(Mod2) 285 marshal_equal(o1) { |o| 286 (class << self; self; end).ancestors 287 } 212 288 end 213 289 … … 303 379 end 304 380 305 module Mod1 end306 module Mod2 end307 381 def test_extend 308 382 o = Object.new