Skip to content
This repository has been archived by the owner on Jun 19, 2020. It is now read-only.

Commit

Permalink
(FACT-2555) Add test for family.
Browse files Browse the repository at this point in the history
  • Loading branch information
Bogdan Irimie committed Apr 27, 2020
1 parent c377f8b commit cae8b56
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions spec/framework/detector/os_detector_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,19 @@
it 'constructs hierarchy with linux' do
expect(OsDetector.instance.hierarchy).to eq(['linux'])
end

context 'when family is known' do
before do
allow(Facter::Resolvers::OsRelease).to receive(:resolve).with(:id_like).and_return(:ubuntu)
allow(os_hierarchy).to receive(:construct_hierarchy).with(:ubuntu).and_return(%w[Linux Debian Ubuntu])
Singleton.__init__(OsDetector)
OsDetector.instance
end

it 'constructs hierarchy with linux' do
expect(OsDetector.instance.hierarchy).to eq(%w[Linux Debian Ubuntu])
end
end
end
end
end
Expand Down

0 comments on commit cae8b56

Please sign in to comment.