<commit_before>module RSpec::Rails::Matchers
  module RoutingMatchers
    extend RSpec::Matchers::DSL

    matcher :route_to do |*route_options|
      match_unless_raises Test::Unit::AssertionFailedError do |path|
        assertion_path = { :method => path.keys.first, :path => path.values.first }

        path, options = *route_options

        if path.is_a?(String)
          parts = path.split("#")
          options ||= {}
          options.merge!({ :controller => parts.first, :action => parts.last })
        else
          options = path
        end

        assert_recognizes(options, assertion_path)
      end<commit_msg>generalize the Assertion failure to work with ruby-1.8 and ruby-1.9<commit_after>module RSpec::Rails::Matchers
  module RoutingMatchers
    extend RSpec::Matchers::DSL

    matcher :route_to do |*route_options|
      match_unless_raises ActiveSupport::TestCase::Assertion do |path|
        assertion_path = { :method => path.keys.first, :path => path.values.first }

        path, options = *route_options

        if path.is_a?(String)
          parts = path.split("#")
          options ||= {}
          options.merge!({ :controller => parts.first, :action => parts.last })
        else
          options = path
        end

        assert_recognizes(options, assertion_path)
      end
{'fraction_non_alphanumeric': 0.11380880121396054, 'fraction_numerical': 0.0030349013657056147, 'mean_word_length': 2.643646408839779, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '814945', 'n_tokens_mistral': 393, 'n_tokens_neox': 380, 'n_words': 86}