# File test-unit-3.5.3/lib/test/unit/collector/xml.rb, line 79 def tag_end(name) state = @state_stack.pop text = @text_stack.pop uri, local = @tag_stack.pop no_action_states = [:root, :stream] case state when *no_action_states # do nothing when :test_suite test_suite_end when :complete_test_case @test_suites.last << @test_case.suite when :test_case test_case_end when :result @result = @values when :test test_end when :pass_assertion @n_pass_assertions += 1 when :backtrace @values = @values_backup @values["backtrace"] = @backtrace when :entry file = @values['file'] line = @values['line'] info = @values['info'] @backtrace << "#{file}:#{line}: #{info}" @values = {} else local = normalize_local(local) @values[local] = text end @ns_stack.pop end
# File test-unit-3.5.3/lib/test/unit/collector/xml.rb, line 46 def tag_start(name, attributes) @text_stack.push('') ns = @ns_stack.last.dup attrs = {} attributes.each do |n, v| if /\Axmlns(?:\z|:)/ =~ n ns[$POSTMATCH] = v else attrs[n] = v end end @ns_stack.push(ns) _parent_tag = parent_tag prefix, local = split_name(name) uri = _ns(ns, prefix) @tag_stack.push([uri, local]) state = next_state(@state_stack.last, uri, local) @state_stack.push(state) @values = {} case state when :test_suite, :test_case # do nothing when :test @n_pass_assertions = 0 if _parent_tag == "start-test" when :backtrace @backtrace = [] @values_backup = @values end end