<feed xmlns='http://www.w3.org/2005/Atom'>
<title>ruby.git/test/ruby/test_class.rb, branch v3_4_9</title>
<subtitle>The Ruby Programming Language</subtitle>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/'/>
<entry>
<title>Rewrite #test_redefinition_mismatch to use a dedicated test class</title>
<updated>2024-08-20T09:36:16+00:00</updated>
<author>
<name>KJ Tsanaktsidis</name>
<email>kj@kjtsanaktsidis.id.au</email>
</author>
<published>2024-08-09T00:35:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=927a44b43f1db2527a4fe6709ec0867dea3ca58f'/>
<id>927a44b43f1db2527a4fe6709ec0867dea3ca58f</id>
<content type='text'>
This test is checking what happens if you try and define a class in a C
extension where that constant is already not a class. It was doing this
by overriding ::Date and then trying to require 'date. The issue with
this is that if we ever add 'date' as a dependency for the test runner,
this test will break because the test runner files get implicitly
required in an `assert_separately` block.

Better use an explicit class for this purpose which can't be accidentally
required elsewhere.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This test is checking what happens if you try and define a class in a C
extension where that constant is already not a class. It was doing this
by overriding ::Date and then trying to require 'date. The issue with
this is that if we ever add 'date' as a dependency for the test runner,
this test will break because the test runner files get implicitly
required in an `assert_separately` block.

Better use an explicit class for this purpose which can't be accidentally
required elsewhere.
</pre>
</div>
</content>
</entry>
<entry>
<title>[Bug #20647] Disallow `return` directly within a singleton class</title>
<updated>2024-07-24T05:44:32+00:00</updated>
<author>
<name>Nobuyoshi Nakada</name>
<email>nobu@ruby-lang.org</email>
</author>
<published>2024-07-24T02:15:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=e642ddf7ae86e306674559ae745823fdbf56ea10'/>
<id>e642ddf7ae86e306674559ae745823fdbf56ea10</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Do not include a backtick in error messages and backtraces</title>
<updated>2024-02-15T09:42:31+00:00</updated>
<author>
<name>Yusuke Endoh</name>
<email>mame@ruby-lang.org</email>
</author>
<published>2024-01-19T07:03:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=25d74b9527cd525042ad0b612b794fa331d3a318'/>
<id>25d74b9527cd525042ad0b612b794fa331d3a318</id>
<content type='text'>
[Feature #16495]
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
[Feature #16495]
</pre>
</div>
</content>
</entry>
<entry>
<title>[Bug #19833] Fix index underflow at superclasses of `BasicObject`</title>
<updated>2023-08-08T10:03:38+00:00</updated>
<author>
<name>Nobuyoshi Nakada</name>
<email>nobu@ruby-lang.org</email>
</author>
<published>2023-08-08T10:03:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=72d1a790cfe0e4a457db98c587f1acaa5e39f001'/>
<id>72d1a790cfe0e4a457db98c587f1acaa5e39f001</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Prevent warning: assigned but unused variable</title>
<updated>2023-05-10T14:49:44+00:00</updated>
<author>
<name>Yusuke Endoh</name>
<email>mame@ruby-lang.org</email>
</author>
<published>2023-05-10T14:49:44+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=a19fa9b2bd94097e973fbdca48722c80b4d9b19f'/>
<id>a19fa9b2bd94097e973fbdca48722c80b4d9b19f</id>
<content type='text'>
http://rubyci.s3.amazonaws.com/debian10/ruby-master/log/20230510T123003Z.log.html.gz
```
/home/chkbuild/chkbuild/tmp/build/20230510T123003Z/ruby/test/objspace/test_objspace.rb:224: warning: assigned but unused variable - c4
/home/chkbuild/chkbuild/tmp/build/20230510T123003Z/ruby/test/ruby/test_class.rb:362: warning: assigned but unused variable - e
/home/chkbuild/chkbuild/tmp/build/20230510T123003Z/ruby/test/ruby/test_process.rb:2602: warning: assigned but unused variable - parent_pid
```
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
http://rubyci.s3.amazonaws.com/debian10/ruby-master/log/20230510T123003Z.log.html.gz
```
/home/chkbuild/chkbuild/tmp/build/20230510T123003Z/ruby/test/objspace/test_objspace.rb:224: warning: assigned but unused variable - c4
/home/chkbuild/chkbuild/tmp/build/20230510T123003Z/ruby/test/ruby/test_class.rb:362: warning: assigned but unused variable - e
/home/chkbuild/chkbuild/tmp/build/20230510T123003Z/ruby/test/ruby/test_process.rb:2602: warning: assigned but unused variable - parent_pid
```
</pre>
</div>
</content>
</entry>
<entry>
<title>fix `NameError` message</title>
<updated>2023-04-19T05:53:56+00:00</updated>
<author>
<name>Koichi Sasada</name>
<email>ko1@atdot.net</email>
</author>
<published>2023-04-19T02:40:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=628e432739e1d2578d357420aa652a97eb8c2649'/>
<id>628e432739e1d2578d357420aa652a97eb8c2649</id>
<content type='text'>
The following code produces two NameErrors respectively
and they are independent, but the second one can show
`private constant` message because of first NameError.

```ruby
class C
  class PrivateClass; end
  private_constant :PrivateClass
end

begin
  eval('class C::PrivateClass; end')
rescue =&gt; e
  p e
end

begin
  Object.const_get 'Foo'
rescue =&gt; e
  p e
end

  #&lt;NameError: private constant C::PrivateClass referenced&gt;
  #&lt;NameError: private constant C::Foo referenced&gt;
  #=&gt; should be #&lt;NameError: uninitialized constant Foo&gt;
```

It fails the test-all tests with
`make test-all TESTS='ruby/class ruby/parse --seed=58891 -v`.

The reason is clear miss from https://github.com/ruby/ruby/commit/7387c08373a
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The following code produces two NameErrors respectively
and they are independent, but the second one can show
`private constant` message because of first NameError.

```ruby
class C
  class PrivateClass; end
  private_constant :PrivateClass
end

begin
  eval('class C::PrivateClass; end')
rescue =&gt; e
  p e
end

begin
  Object.const_get 'Foo'
rescue =&gt; e
  p e
end

  #&lt;NameError: private constant C::PrivateClass referenced&gt;
  #&lt;NameError: private constant C::Foo referenced&gt;
  #=&gt; should be #&lt;NameError: uninitialized constant Foo&gt;
```

It fails the test-all tests with
`make test-all TESTS='ruby/class ruby/parse --seed=58891 -v`.

The reason is clear miss from https://github.com/ruby/ruby/commit/7387c08373a
</pre>
</div>
</content>
</entry>
<entry>
<title>Module#remove_method: Check frozen on the right object</title>
<updated>2022-12-01T22:32:41+00:00</updated>
<author>
<name>Jean byroot Boussier</name>
<email>jean.boussier+github@shopify.com</email>
</author>
<published>2022-12-01T22:32:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=3d272b0fc822f5c2e9c716377b7fcecf15426b27'/>
<id>3d272b0fc822f5c2e9c716377b7fcecf15426b27</id>
<content type='text'>
Previously, the frozen check happened on `RCLASS_ORIGIN(self)`, which
can return an iclass. The frozen check is supposed to respond to objects
that users can call methods on while iclasses are hidden from users.
Other mutation methods like Module#{define_method,alias_method,public}
don't do this. Check frozen status on the module itself.

Fixes [Bug #19164] and [Bug #19166].

Co-authored-by: Alan Wu &lt;XrXr@users.noreply.github.com&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Previously, the frozen check happened on `RCLASS_ORIGIN(self)`, which
can return an iclass. The frozen check is supposed to respond to objects
that users can call methods on while iclasses are hidden from users.
Other mutation methods like Module#{define_method,alias_method,public}
don't do this. Check frozen status on the module itself.

Fixes [Bug #19164] and [Bug #19166].

Co-authored-by: Alan Wu &lt;XrXr@users.noreply.github.com&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>Add Class#attached_object</title>
<updated>2022-10-20T15:30:17+00:00</updated>
<author>
<name>Ufuk Kayserilioglu</name>
<email>ufuk@paralaus.com</email>
</author>
<published>2022-09-26T22:19:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=0378e2f4a8319440dd65c82b16f189161472d237'/>
<id>0378e2f4a8319440dd65c82b16f189161472d237</id>
<content type='text'>
Implements [Feature #12084]

Returns the object for which the receiver is the singleton class, or
raises TypeError if the receiver is not a singleton class.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Implements [Feature #12084]

Returns the object for which the receiver is the singleton class, or
raises TypeError if the receiver is not a singleton class.
</pre>
</div>
</content>
</entry>
<entry>
<title>Remove Class#descendants</title>
<updated>2021-12-20T19:02:15+00:00</updated>
<author>
<name>Jeremy Evans</name>
<email>code@jeremyevans.net</email>
</author>
<published>2021-12-20T16:26:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=3bd5f27f737c7d365b7d01c43d77a958c224ab16'/>
<id>3bd5f27f737c7d365b7d01c43d77a958c224ab16</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>TestClass#test_subclass_gc reduce the number of iteration by 10x</title>
<updated>2021-12-03T11:27:29+00:00</updated>
<author>
<name>Jean Boussier</name>
<email>jean.boussier@gmail.com</email>
</author>
<published>2021-12-03T09:17:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=324d57df0b28982590609d7ae080f82074a82a5c'/>
<id>324d57df0b28982590609d7ae080f82074a82a5c</id>
<content type='text'>
The test was taking 10 seconds on my machine and did timeout
on CI once.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The test was taking 10 seconds on my machine and did timeout
on CI once.
</pre>
</div>
</content>
</entry>
</feed>
