Skip to content

Update generate:stdlib_test#314

Merged
soutaro merged 2 commits intoruby:masterfrom
pocke:fix-generate-stdlib-test
Jun 27, 2020
Merged

Update generate:stdlib_test#314
soutaro merged 2 commits intoruby:masterfrom
pocke:fix-generate-stdlib-test

Conversation

@pocke
Copy link
Member

@pocke pocke commented Jun 27, 2020

This pull request contains several fixes for generate:stdlib_test rake task.

First, it raises an error for accessing unknown constant.
Because it requires rbs library but it accesses to Ruby::Signature constant.
So I replaced Ruby::Signature with RBS.

Second, it generates the old-style test cases, which uses StdlibTest. So I replaced it with the new style test cases.

Third, it isn't aware of libraries. It means the generator does not work for the standard libraries. For example, rake generate:stdlib_test[Pathname] doesn't work.

So I updated the generator to load all standard libraries.
It also loads unnecessary libraries, but I think it is the easiest way.

Copy link
Member

@soutaro soutaro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👏 👏

@soutaro
Copy link
Member

soutaro commented Jun 27, 2020

I'd suggest adding a simple test for the task, like running rake generate:stdlib_test[TESTTESTTEST] and see if it finished without error. @pocke

@pocke
Copy link
Member Author

pocke commented Jun 27, 2020

I'd suggest adding a simple test for the task, like running rake generate:stdlib_test[TESTTESTTEST] and see if it finished without error. @pocke

Thanks for your suggestion! It is a good idea 👍

I've added a simple test in 4072499.

bin/setup
bundle exec rake
bundle exec rake build
RBS_GENERATE_TEST_PATH=/tmp/Array_test.rb bundle exec rake 'generate:stdlib_test[Array]'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😄

@soutaro soutaro merged commit 7f9efd9 into ruby:master Jun 27, 2020
@pocke pocke deleted the fix-generate-stdlib-test branch June 27, 2020 16:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants