<commit_before>require "test_helper"
class CronTest < MiniTest::Unit::TestCase
  def setup
    @test                               = self
    @Fixture, @Gfile, @Script           = Mobilize::Fixture, Mobilize::Gfile, Mobilize::Script
    @Config                             = Mobilize.config.fixture

    @user                               = @Fixture::User.default
    @crontab                            = @Fixture::Crontab.default  @user
  end

  def test_trigger
    _cron, _parent_cron               = nil, nil
    _class_methods                    = Mobilize::Fixture::Cron.methods false
    _trigger_methods                  = _class_methods.select{|_method| _method.to_s.starts_with? "_" }
    _trigger_methods.each            { |_trigger_method|
      puts _trigger_method
      if _trigger_method.to_s.index "parent"

        _parent_cron.delete          if _parent_cron
        _cron.delete                 if _cron
        _cron, _parent_cron           = Mobilize::Fixture::Cron.send _trigger_method, @crontab

      else

        _cron.delete                 if _cron
        _cron                         = Mobilize::Fixture::Cron.send _trigger_method, @crontab

      end
      assert_equal _cron[ :expected ], _cron.triggered?
    }
  end
end<commit_msg>remove puts<commit_after>require "test_helper"
class CronTest < MiniTest::Unit::TestCase
  def setup
    @test                               = self
    @Fixture, @Gfile, @Script           = Mobilize::Fixture, Mobilize::Gfile, Mobilize::Script
    @Config                             = Mobilize.config.fixture

    @user                               = @Fixture::User.default
    @crontab                            = @Fixture::Crontab.default  @user
  end

  def test_trigger
    _cron, _parent_cron               = nil, nil
    _class_methods                    = Mobilize::Fixture::Cron.methods false
    _trigger_methods                  = _class_methods.select{|_method| _method.to_s.starts_with? "_" }
    _trigger_methods.each            { |_trigger_method|
      if _trigger_method.to_s.index "parent"

        _parent_cron.delete          if _parent_cron
        _cron.delete                 if _cron
        _cron, _parent_cron           = Mobilize::Fixture::Cron.send _trigger_method, @crontab

      else

        _cron.delete                 if _cron
        _cron                         = Mobilize::Fixture::Cron.send _trigger_method, @crontab

      end
      assert_equal _cron[ :expected ], _cron.triggered?
    }
  end
end
{'fraction_non_alphanumeric': 0.07811877241929055, 'fraction_numerical': 0.0, 'mean_word_length': 1.598343685300207, 'pattern_counts': {'":': 0, '<': 5, '<?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': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1172717', 'n_tokens_mistral': 757, 'n_tokens_neox': 735, 'n_words': 134}