File: archive_windir_spec.rb

package info (click to toggle)
puppet-module-voxpupuli-archive 7.1.0-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 744 kB
  • sloc: ruby: 2,483; sh: 10; makefile: 4
file content (32 lines) | stat: -rw-r--r-- 670 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# frozen_string_literal: true

require 'spec_helper'
require 'facter/archive_windir'

describe 'archive_windir fact specs', type: :fact do
  subject { Facter.fact(:archive_windir).value }

  before { Facter.clear }

  after { Facter.clear }

  context 'RedHat' do
    before do
      allow(Facter.fact(:osfamily)).to receive(:value).and_return('RedHat')
    end

    it 'is nil on RedHat' do
      expect(subject).to be_nil
    end
  end

  context 'Windows' do
    before do
      allow(Facter.fact(:osfamily)).to receive(:value).and_return('windows')
    end

    it 'defaults to C:\\staging on windows' do
      expect(subject).to eq('C:\\staging')
    end
  end
end