<commit_before>require File.join(File.dirname(__FILE__), '..', 'test_helper')

class CommandsTest < Test::Unit::TestCase
  setup do
    Vagrant::Env.stubs(:load!)

    @persisted_vm = mock("persisted_vm")
    Vagrant::Env.stubs(:persisted_vm).returns(@persisted_vm)
  end

  context "up" do
    setup do
      Vagrant::VM.stubs(:up)
    end

    should "require load the environment" do
      Vagrant::Env.expects(:load!).once
      Vagrant::Commands.up
    end

    should "call up on VM" do
      Vagrant::VM.expects(:up).once<commit_msg>Tests for modified 'up' command<commit_after>require File.join(File.dirname(__FILE__), '..', 'test_helper')

class CommandsTest < Test::Unit::TestCase
  setup do
    Vagrant::Env.stubs(:load!)

    @persisted_vm = mock("persisted_vm")
    Vagrant::Env.stubs(:persisted_vm).returns(@persisted_vm)
  end

  context "up" do
    setup do
      Vagrant::Env.stubs(:persisted_vm).returns(nil)
      Vagrant::VM.stubs(:up)
    end

    should "require load the environment" do
      Vagrant::Env.expects(:load!).once
      Vagrant::Commands.up
    end

    should "error if a persisted VM already exists" do
      Vagrant::Env.expects(:persisted_vm).returns(true)
      Vagrant::Commands.expects(:error_and_exit).once
      Vagrant::VM.expects(:up).never
      Vagrant::Commands.up
    end

    should "call up on VM" do
      Vagrant::VM.expects(:up).once
{'fraction_non_alphanumeric': 0.13606911447084233, 'fraction_numerical': 0.0, 'mean_word_length': 3.5723684210526314, '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': '4913221', 'n_tokens_mistral': 486, 'n_tokens_neox': 477, 'n_words': 90}