File: archive_windir_spec.rb

package info (click to toggle)
puppet-module-puppet-archive 4.1.0-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, forky, sid, trixie
  • size: 688 kB
  • sloc: ruby: 2,152; sh: 30; makefile: 2
file content (25 lines) | stat: -rw-r--r-- 608 bytes parent folder | download | duplicates (2)
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
require 'spec_helper'
require 'facter/archive_windir'

describe 'archive_windir fact specs', type: :fact do
  before { Facter.clear }
  after { Facter.clear }

  context 'RedHat' do
    before do
      Facter.fact(:osfamily).stubs(:value).returns 'RedHat'
    end
    it 'is nil on RedHat' do
      expect(Facter.fact(:archive_windir).value).to be_nil
    end
  end

  context 'Windows' do
    before do
      Facter.fact(:osfamily).stubs(:value).returns 'windows'
    end
    it 'defaults to C:\\staging on windows' do
      expect(Facter.fact(:archive_windir).value).to eq('C:\\staging')
    end
  end
end