<commit_before>require 'test_helper'
require 'rake'

class LocalTransactionsRakeTest < ActiveSupport::TestCase

  setup do
    @rake = Rake::Application.new
    Rake.application = @rake
    Rake.application.rake_require("lib/tasks/local_transactions", [Rails.root.to_s], [])
    Rake::Task.define_task(:environment)
  end

  context "local_transactions:fetch" do
    setup do
      @task_name = "local_transactions:fetch"

      LocalServiceImporter.stubs(:update)
      LocalInteractionImporter.stubs(:update)
      LocalContactImporter.stubs(:update)
    end

    should "call LocalServiceImporter.update" do
      LocalServiceImporter.expects(:update)
      silence_stream(STDERR) do
        @rake[@task_name].invoke
      end
    end

    should "call LocalInteractionImporter.update" do
      LocalInteractionImporter.expects(:update)
      silence_stream(STDERR) do
        @rake[@task_name].invoke
      end
    end

    should "call LocalContactImporter.update" do
      LocalContactImporter.expects(:update)
      silence_stream(STDERR) do
        @rake[@task_name].invoke
      end
    end

  end
end
<commit_msg>No need to silence STDERR in the rake task tests anymore<commit_after>require 'test_helper'
require 'rake'

class LocalTransactionsRakeTest < ActiveSupport::TestCase

  setup do
    @rake = Rake::Application.new
    Rake.application = @rake
    Rake.application.rake_require("lib/tasks/local_transactions", [Rails.root.to_s], [])
    Rake::Task.define_task(:environment)
  end

  context "local_transactions:fetch" do
    setup do
      @task_name = "local_transactions:fetch"

      LocalServiceImporter.stubs(:update)
      LocalInteractionImporter.stubs(:update)
      LocalContactImporter.stubs(:update)
    end

    should "call LocalServiceImporter.update" do
      LocalServiceImporter.expects(:update)
      @rake[@task_name].invoke
    end

    should "call LocalInteractionImporter.update" do
      LocalInteractionImporter.expects(:update)
      @rake[@task_name].invoke
    end

    should "call LocalContactImporter.update" do
      LocalContactImporter.expects(:update)
      @rake[@task_name].invoke
    end
  end
end

{'fraction_non_alphanumeric': 0.09183673469387756, 'fraction_numerical': 0.0, 'mean_word_length': 3.6587473002159827, '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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6073680', 'n_tokens_mistral': 665, 'n_tokens_neox': 651, 'n_words': 121}