<commit_before>require 'test_helper'

module Minitext
  class DefaultSettingsTest < Minitest::Test

    def setup
      Minitext::Base.gateway = Minitext::TestGateway.new
    end

    def test_doesthiswork
      Minitext.set_defaults('hey')
    end

    def test_default_settings_set
      Minitext.set_defaults(from: '1234567890', to: '2222222222', body: 'default message')
      assert_equal Message.defaults[:from], '1234567890'
      assert_equal Message.defaults[:to], '2222222222'
      assert_equal Message.defaults[:body], 'default message'
    end

    def test_single_defaults
      Minitext.set_defaults(from: '1234567890')
      assert Message.new(to: '5558675309', body: 'This is a test text.').valid?, 'Default field not found'

      Minitext.set_defaults(to: '2222222222')
      assert Message.new(from: '1234567890', body: 'This is a test text.').valid?, 'Default field not found'

      Minitext.set_defaults(body: 'default message')
      assert Message.new(from: '1234567890', to: '5558675309').valid?, 'Default field not found'
    end
  end
end
<commit_msg>updated tests<commit_after>require 'test_helper'

module Minitext
  class DefaultSettingsTest < Minitest::Test

    def setup
      Minitext::Base.gateway = Minitext::TestGateway.new
    end

    def test_default_settings_set
      Minitext.set_defaults(from: '1234567890', to: '5558675309', body: 'This is a test text.')
      assert_equal Message.defaults[:from], '1234567890'
      assert_equal Message.defaults[:to], '5558675309'
      assert_equal Message.defaults[:body], 'This is a test text.'
    end

    def test_single_defaults
      Minitext.set_defaults(from: '1234567890')
      assert Message.new(to: '5558675309', body: 'This is a test text.').valid?, 'Default field not found'

      Minitext.set_defaults(to: '5558675309')
      assert Message.new(from: '1234567890', body: 'This is a test text.').valid?, 'Default field not found'

      Minitext.set_defaults(body: 'default message')
      assert Message.new(from: '1234567890', to: '5558675309').valid?, 'Default field not found'
    end
  end
end

{'fraction_non_alphanumeric': 0.11296472831267874, 'fraction_numerical': 0.09532888465204957, 'mean_word_length': 3.927230046948357, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 3, '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': '2874234', 'n_tokens_mistral': 800, 'n_tokens_neox': 657, 'n_words': 169}