repo.or.cz
/
ruby-svn.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
history
|
raw
|
HEAD
* transcode.c (rb_cEncodingConverter): new class Encoding::Converter.
[ruby-svn.git]
/
test
/
ostruct
/
test_ostruct.rb
blob
24ed17f8001a25f6886a0fabd2def95b373c0962
1
require 'test/unit'
2
require 'ostruct'
3
4
class TC_OpenStruct < Test::Unit::TestCase
5
def test_equality
6
o1 = OpenStruct.new
7
o2 = OpenStruct.new
8
assert_equal(o1, o2)
9
10
o1.a = 'a'
11
assert_not_equal(o1, o2)
12
13
o2.a = 'a'
14
assert_equal(o1, o2)
15
16
o1.a = 'b'
17
assert_not_equal(o1, o2)
18
19
o2 = Object.new
20
o2.instance_eval{@table = {:a => 'b'}}
21
assert_not_equal(o1, o2)
22
end
23
end