Sha256: 9131bd16a2869b7385158cb05ad32b9adab21ee0fae6c21a398cae78901bf50b
Contents?: true
Size: 604 Bytes
Versions: 6
Compression:
Stored size: 604 Bytes
Contents
require File.dirname(__FILE__) + '/test_helper.rb' class TestArgsParserFilter < Test::Unit::TestCase def setup @argv = ['--count', '35'] @@err = nil @@name = nil @@value = nil @parser = ArgsParser.parse @argv do arg :count, 'number' filter :count do |v| raise NoMethodError, 'error!!' end on_filter_error do |err, name, value| @@err = err @@name = name @@value = value end end end def test_filter_error assert @@name == :count assert @@value == '35' assert @@err.class == NoMethodError end end
Version data entries
6 entries across 6 versions & 1 rubygems