Sha256: f9df6e834fe7ec679bbc476f003c3ee9a5843a7d3be5d2ac83aa97f690d8c16f

Contents?: true

Size: 920 Bytes

Versions: 349

Compression:

Stored size: 920 Bytes

Contents

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

Version data entries

349 entries across 349 versions & 3 rubygems

Version Path
specinfra-2.91.0 spec/command/factory_spec.rb
specinfra-2.90.1 spec/command/factory_spec.rb
specinfra-2.90.0 spec/command/factory_spec.rb
specinfra-2.89.0 spec/command/factory_spec.rb
specinfra-2.88.2 spec/command/factory_spec.rb
specinfra-2.88.1 spec/command/factory_spec.rb
specinfra-2.88.0 spec/command/factory_spec.rb
specinfra-2.87.2 spec/command/factory_spec.rb
specinfra-2.87.1 spec/command/factory_spec.rb
specinfra-2.87.0 spec/command/factory_spec.rb
specinfra-2.86.0 spec/command/factory_spec.rb
specinfra-2.85.1 spec/command/factory_spec.rb
specinfra-2.85.0 spec/command/factory_spec.rb
specinfra-2.84.1 spec/command/factory_spec.rb
specinfra-2.84.0 spec/command/factory_spec.rb
specinfra-2.83.4 spec/command/factory_spec.rb
specinfra-2.83.3 spec/command/factory_spec.rb
specinfra-2.83.2 spec/command/factory_spec.rb
specinfra-2.83.1 spec/command/factory_spec.rb
specinfra-2.83.0 spec/command/factory_spec.rb