summaryrefslogtreecommitdiff
path: root/test/slop_test.rb
Commit message (Collapse)AuthorAgeFilesLines
* Add basic test for Slop.parseLee Jarvis2020-01-281-0/+10
| | | | See https://github.com/leejarvis/slop/pull/251
* Fix non-deterministic testLee Jarvis2017-05-011-1/+1
| | | | There's a FooOption defined in options_test.rb
* Handle bad constant names in Slop.option_defined?Lee Jarvis2016-08-211-0/+17
| | | | Closes #198
* Start of rewriteLee Jarvis2014-11-181-27/+0
|
* Beginning of Slop 4.0 rewriteLee Jarvis2013-08-291-476/+11
|
* Slop is no longer enumerable, you should use Slop#optionsLee Jarvis2013-08-131-8/+0
|
* Slop::Error now has a slop attribute and a help methodLee Jarvis2013-08-131-0/+10
|
* Slop is now strict by default, and adds --help by defaultLee Jarvis2013-08-131-4/+4
| | | | Also use 1.9 hash syntax
* remove deprecated Slop.optspecLee Jarvis2013-08-131-18/+0
|
* Only raise InvalidOptionError if in strict modeLee Jarvis2013-07-251-0/+5
|
* Ensure unknown options are reported for multiple switchesLee Jarvis2013-07-251-0/+6
| | | | | | | Before this commit we just skipped an option if it wasn't found, we should instead raise an error. closes #122
* Ensure grouping multiple options still consumes trailing argumentLee Jarvis2013-05-141-0/+6
| | | | | | Parsing `-abc foo` should assign `foo` to the `c` option. closes #114
* Allow specifying long options starting with numbersPeter Zotov2013-04-201-0/+1
| | | | It is sometimes useful for a program to accept a version as an option (say, --19 or --1.9).
* Add assert_raises(SystemExit) to prevent test suite from dying when testing ↵Peter Zotov2013-04-201-4/+10
| | | | --help.
* ensure default help exit test does not print to stdoutLee Jarvis2013-03-221-3/+5
|
* Adding a test for the behavior added by ce2b17e and 258a21d.Autumn Perrault2013-03-101-0/+7
|
* avoid 1.9+ syntax in testsLee Jarvis2013-03-051-1/+1
|
* disable run callback when help option is usedLee Jarvis2013-03-051-0/+15
| | | | closes #106
* remove old command tests and comment out optspec testLee Jarvis2013-01-141-17/+17
|
* use temp_stdout instead of temp_stderr for redirecting help outputLee Jarvis2013-01-141-6/+6
|
* ensure any new options replace old ones so no duplicates existLee Jarvis2013-01-131-0/+9
| | | | closes #100
* avoid 1.9 specific syntax for testsLee Jarvis2013-01-081-1/+1
|
* added default usage string to help outputLee Jarvis2013-01-081-2/+8
|
* clean up unused variables in runner testLee Jarvis2013-01-061-5/+2
|
* implement Slop#run methodLee Jarvis2013-01-061-0/+14
|
* simplify testsLee Jarvis2012-10-221-6/+1
|
* Merge branch 'master' of github.com:injekt/slopLee Jarvis2012-10-221-0/+18
|\ | | | | | | | | Conflicts: test/slop_test.rb
| * add test-suite for arity checker of Slop#respond_to?Kenichi Kamiya2012-10-201-0/+18
| |
* | add test-suite for specify visibility of Slop#method_missingKenichi Kamiya2012-10-201-0/+4
|/
* Add test suite for to specify the interface of constructorsKenichi Kamiya2012-10-151-0/+41
|
* Revert "fix block-scope of "Slop.new" and other constructors(e.g: ↵Lee Jarvis2012-10-151-25/+0
| | | | | | | | | Slop.parse), these are influenced by arity number. this problem is same as #81" This reverts commit 89215e48ea4ed63319634118286ad9a0dc6a747b. Conflicts: test/slop_test.rb
* ensure 'no-foo' options are not inverted when parsing '--no-foo'Lee Jarvis2012-10-111-1/+11
| | | | closes #86
* add test-case for fix Slop#to_s, that brake config-bannerKenichi Kamiya2012-10-111-0/+10
|
* Merge branch 'master' of github.com:injekt/slopLee Jarvis2012-09-191-0/+26
|\
| * fix block-scope of "Slop.new" and other constructors(e.g: Slop.parse), these ↵Kenichi Kamiya2012-09-171-0/+26
| | | | | | | | are influenced by arity number. this problem is same as #81
* | support opts.foo_bar? check falling back on 'foo-bar' optionLee Jarvis2012-09-191-0/+8
|/ | | | | | | | | | Current to check an option with an - character you would need either to use opts.present?('foo-bar') or opts['foo-bar']. THIS IS NOT ENOUGH :metal: So let's fall back to supporting opts.foo_bar? which (unless foo_bar exist, will check for 'foo-bar' next. COOL HUH?)
* avoid using #present? when checking for an options present in autocreateLee Jarvis2012-08-241-0/+7
| | | | | | | | | the present? method checks that an option exists AND has been used in the argument list. autocreate works should just check for an options existence not if the option has been used or not, if the option already exists, autocreate should skip it. Before this commit, that was not the case closes #77 again
* ensure autocreate arguments are not created as optionsLee Jarvis2012-08-211-0/+1
| | | | closes #77
* ensure options are not swallowed when using options with arguments included ↵Lee Jarvis2012-08-141-0/+5
| | | | | | in value closes #74
* Stop multiple switches from trashing argumentsConrad Irwin2012-05-311-0/+6
|
* Merge branch 'master' into to_hash_boolean_optionsLee Jarvis2012-05-151-0/+7
|\
| * an explicit test for underscore supportchuck son2012-05-141-0/+7
| |
* | avoid using instance_variable_defined? for checking valueLee Jarvis2012-04-301-1/+1
| | | | | | | | ref #59
* | added failing assertion for to_hash boolean optionsLee Jarvis2012-04-301-3/+3
| |
* | Merge branch 'to_hash_take2' of https://github.com/no6v/slop into ↵Lee Jarvis2012-04-301-4/+4
|\ \ | |/ |/| | | no6v-to_hash_take2
| * fix test for to_hash and get/[]Nobuhiro IMAI2012-02-291-4/+4
| |
* | ensure separator before any options is still being processedLee Jarvis2012-04-241-0/+6
| | | | | | | | closes #62
* | ensure separators arent replacing existing separatorsLee Jarvis2012-04-231-1/+2
|/ | | | closes #61
* ensure opt=arg syntax does not consume following argumentLee Jarvis2012-01-311-0/+7
| | | | fixes #55
* fix option terminator parsingLee Jarvis2012-01-301-0/+7
|