Conversation
| library "find" | ||
|
|
||
| def test_version | ||
| assert_instance_of String, Find::VERSION |
There was a problem hiding this comment.
Please use assert_const_type for testing constant types.
| def test_transaction | ||
| Dir.mktmpdir do |dir| | ||
| file = File.join(dir, "test.pstore") | ||
| store = PStore.new(file) | ||
| store.transaction do | ||
| store[:key] = "val" | ||
| end | ||
| store.transaction(true) do | ||
| assert_equal "val", store[:key] | ||
| end | ||
| end | ||
| end |
There was a problem hiding this comment.
Please use assert_send_type to test the type of method.
| def test_open | ||
| PTY.open do |master, slave| | ||
| assert_instance_of IO, master | ||
| assert_instance_of File, slave | ||
| end |
There was a problem hiding this comment.
Please use assert_const_type to test constants.
| assert_send_type "(*String command) { ([ ::IO, ::IO, ::Integer ]) -> ::Integer } -> nil", | ||
| PTY, :getpty, "echo" do |r, w, pid| 1 end | ||
| def test_child_exited | ||
| assert_equal RuntimeError, PTY::ChildExited.superclass |
There was a problem hiding this comment.
Please use assert_const_type to test constants.
| def test_constants | ||
| assert_instance_of String, StringIO::VERSION | ||
| assert_instance_of Integer, StringIO::MAX_LENGTH | ||
| end |
There was a problem hiding this comment.
Please use assert_const_type to test constants.
| def test_length | ||
| s = StringIO.new("hello") | ||
| assert_equal 5, s.length | ||
| assert_equal s.size, s.length | ||
| end |
There was a problem hiding this comment.
Please use assert_send_type to test the method's type.
| assert_instance_of Timeout::ExitException, exc | ||
| :ok | ||
| end | ||
| assert_equal :ok, res |
There was a problem hiding this comment.
Please use assert_send_type to test the method's type.
| end | ||
|
|
||
| def test_in_progress_error | ||
| assert_equal Zlib::Error, Zlib::InProgressError.superclass |
There was a problem hiding this comment.
Please use assert_const_type for testing constant types.
|
|
||
| def test_handle_timeout | ||
| res = Timeout::Error.handle_timeout("msg") do |exc| | ||
| assert_instance_of Timeout::ExitException, exc |
There was a problem hiding this comment.
Please use assert_const_type for testing constant types.
| testing "singleton(::Timeout)" | ||
|
|
||
| def test_version | ||
| assert_instance_of String, Timeout::VERSION |
There was a problem hiding this comment.
Please use assert_const_type for testing constant types.
…athname, pty, stringio, timeout, zlib) Add missing methods, classes, and constants for `find`, `pathname`, `pty`, `stringio`, `timeout`, and `zlib`. Note: `pstore` has been excluded as it is in `ALUMNI_STDLIBS` and planned to be removed from the rbs repo. | Ruby Method | Change | C function | |---|---|---| | `Find.prune` | Add singleton method `prune` | https://github.com/ruby/ruby/blob/v4.0.7/lib/find.rb#L86-L92 | | `Find::VERSION` | Add constant `VERSION` | https://github.com/ruby/ruby/blob/v4.0.7/lib/find.rb#L4-L6 | | `Pathname#empty?` | Add method `empty?` returning `bool` | https://github.com/ruby/ruby/blob/v4.0.7/ext/pathname/pathname.c#L1228-L1236 | | `Pathname.glob` | Add singleton method `glob` | https://github.com/ruby/ruby/blob/v4.0.7/ext/pathname/pathname.c#L1238-L1248 | | `Pathname#glob` | Add method `glob` returning `Array[Pathname]` or `Enumerator` | https://github.com/ruby/ruby/blob/v4.0.7/ext/pathname/pathname.c#L1250-L1262 | | `PTY::ChildExited` | Add exception class inheriting `RuntimeError` | https://github.com/ruby/ruby/blob/v4.0.7/ext/pty/pty.c | | `PTY::ChildExited#status` | Add method `status` returning `Process::Status` | https://github.com/ruby/ruby/blob/v4.0.7/ext/pty/pty.c | | `StringIO#length` | Add alias of `size` returning `Integer` | https://github.com/ruby/stringio/blob/master/ext/stringio/stringio.c | | `StringIO::MAX_LENGTH` | Add constant `MAX_LENGTH` | https://github.com/ruby/stringio/blob/master/ext/stringio/stringio.c | | `StringIO::VERSION` | Add constant `VERSION` | https://github.com/ruby/stringio/blob/master/ext/stringio/stringio.c | | `Timeout::Error.handle_timeout` | Add singleton method `handle_timeout` | https://github.com/ruby/timeout/blob/master/lib/timeout.rb | | `Zlib::InProgressError` | Add exception class inheriting `Zlib::Error` | https://github.com/ruby/zlib/blob/master/ext/zlib/zlib.c |
9ef5832 to
3e5819f
Compare
|
Following the feedback on other PRs regarding |
Add missing methods, classes, and constants for
find,pathname,pty,stringio,timeout, andzlib.Note:
pstorehas been excluded as it is inALUMNI_STDLIBSand planned to be removed from the rbs repo.Changes
Find.prunepruneFind::VERSIONVERSIONPathname#empty?empty?returningboolPathname.globglobPathname#globglobreturningArray[Pathname]orEnumeratorPTY::ChildExitedRuntimeErrorPTY::ChildExited#statusstatusreturningProcess::StatusStringIO#lengthsizereturningIntegerStringIO::MAX_LENGTHMAX_LENGTHStringIO::VERSIONVERSIONTimeout::Error.handle_timeouthandle_timeoutZlib::InProgressErrorZlib::Error