<commit_before>module NamedMapsHelper
  def bypass_named_maps
    Carto::NamedMaps::Api.any_instance.stubs(show: nil, create: true, update: true, destroy: true)
  end
end
<commit_msg>Better named maps stubs<commit_after>module NamedMapsHelper
  def bypass_named_maps
    mocked_response = mock
    mocked_response.stubs(code: 200, response_body: '{}')

    mocked_http_client = Carto::Http::Client.get('named_maps')
    mocked_http_client.stubs(:perform_request).returns(mocked_response)

    Carto::NamedMaps::Api.any_instance.stubs(http_client: mocked_http_client, show: nil)
  end
end

{'fraction_non_alphanumeric': 0.10204081632653061, 'fraction_numerical': 0.00510204081632653, 'mean_word_length': 6.271604938271605, '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': '3725763', 'n_tokens_mistral': 210, 'n_tokens_neox': 201, 'n_words': 35}