forked from mizzy/specinfra
-
Notifications
You must be signed in to change notification settings - Fork 0
/
factory_spec.rb
30 lines (25 loc) · 920 Bytes
/
factory_spec.rb
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
require 'spec_helper'
describe 'create_command_class work correctly' do
before do
property[:os] = nil
end
context 'family: base, release: nil' do
before do
set :os, :family => 'base'
end
it { expect(Specinfra.command.send(:create_command_class, 'file')).to eq Specinfra::Command::Base::File }
end
context 'family: redhat, release: nil' do
before do
set :os, :family => 'redhat'
end
it { expect(Specinfra.command.send(:create_command_class, 'file')).to eq Specinfra::Command::Redhat::Base::File }
it { expect(Specinfra.command.send(:create_command_class, 'selinux')).to eq Specinfra::Command::Linux::Base::Selinux }
end
context 'family: redhat, release: 7' do
before do
set :os, :family => 'redhat', :release => 7
end
it { expect(Specinfra.command.send(:create_command_class, 'file')).to eq Specinfra::Command::Redhat::V7::File }
end
end