<commit_before>require "spec_helper"

describe "nginx::enabledisablesite" do
  let(:chef_run) do
    ChefSpec::Runner.new.converge(described_recipe)
  end

  it "creates the `nxensite` script" do
    ::File.stub(:exists?).with(anything).and_call_original
    ::File.stub(:exists?).with("/usr/sbin/nxensite").and_return(false)

    expect(chef_run).to create_template("/usr/sbin/nxensite").with(
      source: "nxensite.erb",
      owner: "root",
      group: "root",
      mode:  "0755"
    )
  end

  it "creates the `nxdissite` link" do
    ::File.stub(:exists?).with(anything).and_call_original
    ::File.stub(:exists?).with("/usr/sbin/nxensite").and_return(true)
    ::File.stub(:symlink?).with("/usr/sbin/nxdissite").and_return(false)

    expect(chef_run).to run_execute("ln -s /usr/sbin/nxensite /usr/sbin/nxdissite")
  end

  it "creates bash completion `nxendissite`" do
    ::File.stub(:exists?).with(anything).and_call_original
    ::File.stub(:exists?).with("/etc/bash_completion.d/nxendissite").and_return(false)
<commit_msg>Need to stub the exist call since I changed it<commit_after>require "spec_helper"

describe "nginx::enabledisablesite" do
  let(:chef_run) do
    ChefSpec::Runner.new.converge(described_recipe)
  end

  it "creates the `nxensite` script" do
    ::File.stub(:exist?).with(anything).and_call_original
    ::File.stub(:exist?).with("/usr/sbin/nxensite").and_return(false)

    expect(chef_run).to create_template("/usr/sbin/nxensite").with(
      source: "nxensite.erb",
      owner: "root",
      group: "root",
      mode:  "0755"
    )
  end

  it "creates the `nxdissite` link" do
    ::File.stub(:exist?).with(anything).and_call_original
    ::File.stub(:exist?).with("/usr/sbin/nxensite").and_return(true)
    ::File.stub(:symlink?).with("/usr/sbin/nxdissite").and_return(false)

    expect(chef_run).to run_execute("ln -s /usr/sbin/nxensite /usr/sbin/nxdissite")
  end

  it "creates bash completion `nxendissite`" do
    ::File.stub(:exist?).with(anything).and_call_original
    ::File.stub(:exist?).with("/etc/bash_completion.d/nxendissite").and_return(false)

{'fraction_non_alphanumeric': 0.1700712589073634, 'fraction_numerical': 0.003800475059382423, 'mean_word_length': 4.372448979591836, 'pattern_counts': {'":': 0, '<': 3, '<?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': '3805556', 'n_tokens_mistral': 808, 'n_tokens_neox': 777, 'n_words': 111}