diff options
-rw-r--r-- | test/ripper/test_parser_events.rb | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/test/ripper/test_parser_events.rb b/test/ripper/test_parser_events.rb index 1942157b89..ed026785db 100644 --- a/test/ripper/test_parser_events.rb +++ b/test/ripper/test_parser_events.rb @@ -9,13 +9,10 @@ end class TestRipper::ParserEvents < Test::Unit::TestCase - # should be enabled def test_event_coverage - dispatched = Ripper::PARSER_EVENTS.map {|event,*| event } - dispatched.each do |e| - assert_equal true, respond_to?("test_#{e}", true), - "event not tested: #{e.inspect}" - end + dispatched = Ripper::PARSER_EVENTS + tested = self.class.instance_methods(false).grep(/\Atest_(\w+)/) {$1.intern} + assert_empty dispatched-tested end def parse(str, nm = nil, &bl) @@ -249,9 +246,8 @@ class TestRipper::ParserEvents < Test::Unit::TestCase assert_equal true, thru_begin end - def test_binary - thru_binary = nil - %w"and or + - * / % ** | ^ & <=> > >= < <= == === != =~ !~ << >> && ||".each do |op| + %w"and or + - * / % ** | ^ & <=> > >= < <= == === != =~ !~ << >> && ||".each do |op| + define_method("test_binary(#{op})") do thru_binary = false parse("a #{op} b", :on_binary) {thru_binary = true} assert_equal true, thru_binary |