[Bug #891] MiniTest::Assertions#assert_instance_of should use Object#instance_of?

Bug #891: MiniTest::Assertions#assert_instance_of should use
Object#instance_of?
http://redmine.ruby-lang.org/issues/show/891

e$B5/I<<Te(B: okkez _
e$B%9%F!<%?%9e(B: Open, e$BM%@hEYe(B: Normal
e$B%+%F%4%je(B: lib

e$B%?%$%H%k$NDL$j$J$N$G$9$,!"e(BMiniTest::Assertions#assert_instance_of
e$B$N<BAu$,$*$+$7$$$H;W$$$^$9!#e(B
Module#=== e$B$G$O$J$/$Fe(B Object#instance_of?
e$B$r;HMQ$9$k$Y$-$G$O$J$$$G$7$g$&$+!)e(B
test/unit e$B$G$Oe(B Object#instance_of? e$B$r;HMQ$7$F$$$^$7$?!#e(B

e$B$^$D$b$He(B e$B$f$-$R$m$G$9e(B

In message “Re: [ruby-dev:37458] [Bug #891]
MiniTest::Assertions#assert_instance_of should use Object#instance_of?”
on Tue, 16 Dec 2008 16:26:38 +0900, okkez _ [email protected]
writes:

|e$B%?%$%H%k$NDL$j$J$N$G$9$,!"e(BMiniTest::Assertions#assert_instance_of e$B$N<BAu$,$*$+$7$$$H;W$$$^$9!#e(B
|Module#=== e$B$G$O$J$/$Fe(B Object#instance_of? e$B$r;HMQ$9$k$Y$-$G$O$J$$$G$7$g$&$+!)e(B

e$B$3$N$U$?$D$OF1$8F/$-$G$9$,!"!V$*$+$7$$!W$H$$$&$N$O$I$&$$$&0Ue(B
e$BL#$G$7$g$&$+!#!V$h$jNI$/0U?^$rI=8=$9$k!W$H$+$$$&$h$&$J0UL#$Ge(B
e$B$"$l$P!"%P%[email protected]$($J$$$h$&$J!#e(B

From: Yukihiro M. [email protected]
Subject: [ruby-dev:37459] Re: [Bug #891]
MiniTest::Assertions#assert_instance_of should use Object#instance_of?
Date: Tue, 16 Dec 2008 17:33:46 +0900

|Module#=== e$B$G$O$J$/$Fe(B Object#instance_of? e$B$r;HMQ$9$k$Y$-$G$O$J$$$G$7$g$&$+!)e(B

e$B$3$N$U$?$D$OF1$8F/$-$G$9$,!"!V$*$+$7$$!W$H$$$&$N$O$I$&$$$&0Ue(B

Object#instance_of?e$B$O%5%V%/%i%[email protected][email protected]$a$G$9$h$M!#e(B

Numeric === 1 # => true
Fixnum === 1 # => true
1.instance_of? Fixnum # => true
1.instance_of? Numeric # => false

okkez e$B$G$9!#e(B

Ruby

e$B$N%j%S%k%I$r$7$F$k4V$K$k$S$-$A$5$s$,%U%)%m!<$7$F$/[email protected]$5$C$F$^$9$,e(B

e$B$5$C$-%S%k%I$7$?e(B Ruby e$B$G3NG’$7$F$_$^$7$?!#e(B

2008/12/16 17:33 Yukihiro M. [email protected]:

e$B$"$l$P!"%P%[email protected]$($J$$$h$&$J!#e(B

e$B0J2<$N$h$&$J<B9T7k2L$K$J$k$+$i$G$9!#e(B
Object#instance_of?(klass) e$B$O%l%7!<%P$,e(B klass
e$B$ND>@$N%$%s%9%?%s%9$K$J$C$F$$$ke(B
e$B>[email protected]$1e(B true e$B$rJV$7$^$9!#e(B

RUBY_DESCRIPTION
=> “ruby 1.9.1 (2008-12-16 revision 20782) [i686-linux]”

String === ‘a’
=> true

Object === ‘a’
=> true

‘a’.kind_of?(String)
=> true

‘a’.kind_of?(Object)
=> true

‘a’.instance_of?(String)
=> true

‘a’.instance_of?(Object)
=> false

e$B%A%1%C%He(B #891 e$B$,99?7$5$l$^$7$?!#e(B (by Yukihiro M.)

e$B%9%F!<%?%9e(B Opene$B$+$ie(BClosede$B$KJQ99e(B
e$B?JD=e(B % 0e$B$+$ie(B100e$B$KJQ99e(B

Applied in changeset r20798.

http://redmine.ruby-lang.org/issues/show/891

e$B$^$D$b$He(B e$B$f$-$R$m$G$9e(B

In message “Re: [ruby-dev:37464] Re: [Bug #891]
MiniTest::Assertions#assert_instance_of should use Object#instance_of?”
on Tue, 16 Dec 2008 20:22:23 +0900, okkez [email protected]
writes:

|e$B0J2<$N$h$&$J<B9T7k2L$K$J$k$+$i$G$9!#e(B
|Object#instance_of?(klass) e$B$O%l%7!<%P$,e(B klass e$B$ND>@$N%$%s%9%?%s%9$K$J$C$F$$$ke(B
|e$B>[email protected]$1e(B true e$B$rJV$7$^$9!#e(B

e$B$J$k$[$I!#%3%_%C%H$7$^$9!#e(B

[email protected]!“e(Bminiteste$B$Oe(BRyan D.e$B$,%a%s%F%J$G$9$+$i!”:#8e$Oe(B
ruby-coree$B$K%l%]!<%[email protected]$/$N$,3N<[email protected]$H;W$$$^$9!#:#2s$Ne(B
e$B%3%_%C%H$,%m%9%H$7$J$-$c$$$$$1$I!#e(B

okkez e$B$G$9!#e(B

2008/12/16 22:05 Yukihiro M. [email protected]:

[email protected]!“e(Bminiteste$B$Oe(BRyan D.e$B$,%a%s%F%J$G$9$+$i!”:#8e$Oe(B
ruby-coree$B$K%l%]!<%[email protected]$/$N$,3N<[email protected]$H;W$$$^$9!#:#2s$Ne(B
e$B%3%_%C%H$,%m%9%H$7$J$-$c$$$$$1$I!#e(B

e$B<!$+$i$Oe(B ruby-core e$B$K%l%]!<%H$9$k$h$&$K$7$^$9!#e(B

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs