<commit_before># encoding: UTF-8

module Wizzard

  describe App do

    RSpec::Matchers.define :json_decode_to do |expected|
      match do |actual|
        actual.ok? and
        actual.headers['Content-Type'] == 'application/json;charset=utf-8' and
        JSON.parse(actual.body) == expected
      end
      failure_message_for_should do |actual|
        "expected #{actual.body} to JSON-decode to #{expected}"
      end
    end

    include Rack::Test::Methods

    def app
      App
    end<commit_msg>looking for a nice way to express this in multiple lines<commit_after># encoding: UTF-8

module Wizzard

  describe App do

    RSpec::Matchers.define :json_decode_to do |expected|
      match do |actual|
        [
          actual.ok?,
          actual.headers['Content-Type'] == 'application/json;charset=utf-8',
          JSON.parse(actual.body) == expected,
        ].all?
      end
      failure_message_for_should do |actual|
        "expected #{actual.body} to JSON-decode to #{expected}"
      end
    end

    include Rack::Test::Methods

    def app
      App
    end
{'fraction_non_alphanumeric': 0.10230414746543778, 'fraction_numerical': 0.003686635944700461, 'mean_word_length': 2.4367088607594938, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '4193723', 'n_tokens_mistral': 332, 'n_tokens_neox': 317, 'n_words': 88}