File: registry_spec.rb

package info (click to toggle)
ruby-rspec-puppet 4.0.2%2Bds-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,444 kB
  • sloc: ruby: 6,377; makefile: 6
file content (35 lines) | stat: -rw-r--r-- 849 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
33
34
35
# frozen_string_literal: true

require 'spec_helper'

describe Win32::Registry do
  subject { described_class }

  let(:stub_class) { RSpec::Puppet::Win32::Registry }

  context 'on non-windows', unless: windows? do
    it { is_expected.not_to be_nil }

    it 'uses the stubbed rspec-puppet version' do
      expect(subject).to eq(stub_class)
    end
  end

  context 'on windows', if: windows? do
    it { is_expected.not_to be_nil }

    it 'does not use the stubbed rspec-puppet version' do
      expect(subject).not_to eq(stub_class)
    end

    describe Win32::Registry::Constants do
      described_class.constants.each do |const_name|
        context const_name.to_s do
          subject { described_class.const_get(const_name) }

          it { is_expected.to eq(stub_class.const_get(const_name)) }
        end
      end
    end
  end
end