-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Python tests ported #12
Conversation
. Old test moved to test_docopt_rb.rb (class DocoptTest renamed to DocoptRbTest) - but they fails due to absence of example.rb. Three tests ported from python failed: 1) Set doesn't glue equal Arguments (#test_set) 2) docopt parses '[--]' into '--' not true as python implementation (#test_allow_double_underscore) 3) the same is true for '[-]' (#test_allow_single_underscore) One test (#test_issue34_unicode_strings) not implemented (it's about unicode)
This looks really good for me. Also shows that language-agnostic tests have worse test-coverage than Python tests—that means I need to port more Python tests to language-agnostic tests. (Also, I recently discovered Good job! I'm not Rubyist so it's best that @shabbyrobe and @njoh take a look at this to decide if this can be merged without changes. |
Yay!! Thank you @prijutme4ty ! : ) Also, automating tests for different ruby versions sounds reasonable to me.. maybe on travis-ci. |
This is fantastic! Thank you very much. I have merged into the develop branch: 00a567d Are these tests failing for you too?
Also, what would be the best practice for including that file that is failing in test_docopt_rb.rb? The file in question is actually called examples/example_options.rb. |
Thank you for merging! Not to forget - there were two test: assert_raise(Docopt::Exit) { I've easily ported this but can't understand why such a strange syntax used. @shabbyrobe, yes these 3 tests fails for me too. I've described in commit info, reasons of failure. |
@prijutme4ty assert_raise(Docopt::Exit) {
assert_equal docopt('usage: prog [-vv]', '-vvv')
}
See docopt/docopt#30. Would be interesting to hear—what do you think of this feature? |
@halst I think this feature is ok, but I can't realize where I can use it :) Not so many applications use smth like -vvv option. |
Actually there are quite a few applications I've found in my collection of saved help messages that make use of the counted short option. @halst, I think you were right all along though: -v3 makes much more sense. Oh well, it's in there now, is there any cost to keeping it in? |
I think we should definitely keep it, because (as I said earlier) this functionality fills gap in syntax interpretation—how to interpret |
Old test moved to test_docopt_rb.rb (class DocoptTest renamed to DocoptRbTest) -
but they fails due to absence of example.rb.
Three tests ported from python failed:
One test (#test_issue34_unicode_strings) not implemented (it's about unicode)