<commit_before>require File.expand_path("../../../../base", __FILE__)

describe Vagrant::Plugin::V2::Trigger do
  include_context "unit"

  let(:iso_env) do
    # We have to create a Vagrantfile so there is a root path
    isolated_environment.tap do |env|
      env.vagrantfile("")
    end
  end
  let(:iso_vagrant_env) { iso_env.create_vagrant_env }
  let(:machine) { iso_vagrant_env.machine(iso_vagrant_env.machine_names[0], :dummy) }
  let(:config)  { double("config") } # actually flush this out into a trigger config
  let(:env) { {
    machine: machine,
    ui: Vagrant::UI::Silent.new,
  } }


  let(:subject) { described_class.new(env, config, machine) }

  context "firing before triggers" do
  end

  context "firing after triggers" do
  end

  context "filtering triggers" do
  end

  context "firing triggers" do
  end

  context "executing info" do
    let(:message) { "Printing some info" }

    it "prints messages at INFO" do
      output = ""
      allow(machine.ui).to receive(:info) do |data|
        output << data
      end

      subject.send(:info, message)
      expect(output).to include(message)
    end
  end

  context "executing warn" do
    let(:message) { "Printing some warnings" }

    it "prints messages at WARN" do
      output = ""
      allow(machine.ui).to receive(:warn) do |data|
        output << data
      end

      subject.send(:warn, message)
      expect(output).to include(message)
    end
  end

  context "executing run" do
  end

  context "executing run_remote" do
  end
end
<commit_msg>Update rspec tests for trigger plugin<commit_after>require File.expand_path("../../../../base", __FILE__)

describe Vagrant::Plugin::V2::Trigger do
  include_context "unit"

  let(:iso_env) do
    # We have to create a Vagrantfile so there is a root path
    isolated_environment.tap do |env|
      env.vagrantfile("")
    end
  end
  let(:iso_vagrant_env) { iso_env.create_vagrant_env }
  let(:machine) { iso_vagrant_env.machine(iso_vagrant_env.machine_names[0], :dummy) }
  let(:config)  { double("config") } # actually flush this out into a trigger config
  let(:env) { {
    machine: machine,
    ui: Vagrant::UI::Silent.new,
  } }


  let(:subject) { described_class.new(env, config, machine) }

  context "#fire_triggers" do
    it "raises an error if an inproper stage is given" do
      expect{ subject.fire_triggers(:up, :not_real, "guest") }.
       to raise_error(Vagrant::Errors::TriggersNoStageGiven)
    end
  end

  context "#filter_triggers" do
  end

  context "#fire" do
  end

  context "#info" do
    let(:message) { "Printing some info" }

    it "prints messages at INFO" do
      output = ""
      allow(machine.ui).to receive(:info) do |data|
        output << data
      end

      subject.send(:info, message)
      expect(output).to include(message)
    end
  end

  context "#warn" do
    let(:message) { "Printing some warnings" }

    it "prints messages at WARN" do
      output = ""
      allow(machine.ui).to receive(:warn) do |data|
        output << data
      end

      subject.send(:warn, message)
      expect(output).to include(message)
    end
  end

  context "#run" do
  end

  context "#run_remote" do
  end
end

{'fraction_non_alphanumeric': 0.11917422583672192, 'fraction_numerical': 0.0012511729746637473, 'mean_word_length': 2.99250936329588, 'pattern_counts': {'":': 0, '<': 11, '<?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': '1074190', 'n_tokens_mistral': 1077, 'n_tokens_neox': 1034, 'n_words': 291}