Conversation
|
@hsbt, I have switched over to test-unit. However, I did not find a substitute for capture_subprocess_io, so have commented out the offending test method test_required_argument_missing. |
|
You should rename |
I quite agree, but I could not think of a good name: dummy.rb? target.rb? program.rb? I welcome suggestions. For now, I'll name it test/options.rb. |
|
I've responded to comments, and also added some explanation of how the tests work. |
|
Changed the name of the test program to t.rb. |
|
This test is not working on https://github.com/ruby/ruby. Because spawning |
Thanks @hsbt. I don't know about that. Can you give some direction? Or even make the needed changes in the PR? |
|
I'm going to see whether I can find an entirely different test strategy. |
|
I have a new strategy that does not involve either subprocess or t.rb. Please don't spend time with this until I update with new stuff. |
|
I have changed the test strategy. Instead of using a command-line, I'm using a dummy ARGV, which greatly simplifies things. |
|
Once we've settled on a strategy, there's much more testing that I can add. Also: amazing how much I've learned by doing these tests. |
|
I probably should have said more about this new test strategy. In the end, I think it is a good thing that there was a problem with spawning a process. It made me think things through and realize that GetoptLong doesn't get its input from the command line; it gets it from ARGV. So that can be our test source, not the command line. Btw, I learned on the web that ARGV = causes a warning, while ARGV.replace does not. |
|
Don't use generic file name like |
Changed. |
| actual_options = [] | ||
| opts.each do |opt, arg| | ||
| actual_options << "#{opt}: #{arg}" | ||
| end |
There was a problem hiding this comment.
Minor: could we #map over the collection?
|
@BurdetteLamar 🎉 Looking better and better, and the "revised test strategy" seems intuitive and easy to follow. |
Thanks, @olleolleolle, for your encouragement. |
|
@hsbt, can we get this PR reviewed, approved, and merged? I'll have much more, both RDoc and tests. Thanks. |
|
👍 This test is working with ruby core repo. But I got the some of warnings like: Can you suppress them? |
|
Running quiet now. |
|
@BurdetteLamar Merged. Additional request: You should write a descriptive commit message in the next time. I wonder why you ignore its advice. |
Not sure what you mean, @hsbt. Is it that each commit should have a distinct message? (There's lots I don't know, but I don't deliberately ignore things.) |
I started out to enhance the RDoc for GetoptLong. There were some things I did not understand, so I looked for the tests, which are often clarifying. There were none. So here are some. More to come.