Sha256: 0e8e0a725110b4b95b9a284847a69316ca81ab0fd50f36de8ca6cc5a1a4269b3

Contents?: true

Size: 1.25 KB

Versions: 2

Compression:

Stored size: 1.25 KB

Contents

require "mixlib/shellout"
require "bundler"

describe "Chef Fips Specs" do
  def windows?
    if RUBY_PLATFORM =~ /mswin|mingw|windows/
      true
    else
      false
    end
  end

  let(:chef_dir) do
    if windows?
      Dir.glob("c:/opscode/chef/embedded/lib/ruby/gems/*/gems/chef-[0-9]*").last
    else
      Dir.glob("/opt/chef/embedded/lib/ruby/gems/*/gems/chef-[0-9]*").last
    end
  end

  let(:path) do
    if windows?
      'C:\opscode\chef\embedded\bin'
    else
      "/opt/chef/embedded/bin"
    end
  end

  it "passes the unit and functional specs" do
    Bundler.with_clean_env do
      ruby_cmd = Mixlib::ShellOut.new(
        "bundle exec rspec -t ~requires_git spec/unit spec/functional", :env => { "PATH" => [ENV["PATH"], path].join(File::PATH_SEPARATOR),
                                                                                  "GEM_PATH" => nil, "GEM_CACHE" => nil, "GEM_HOME" => nil,
                                                                                  "CHEF_FIPS" => "1" },
                                                                        :live_stream => STDOUT, :cwd => chef_dir, :timeout => 3600)
      expect { ruby_cmd.run_command.error! }.not_to raise_exception
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
chef-12.8.1 acceptance/fips/test/integration/fips/serverspec/fips_spec.rb
chef-12.8.1-universal-mingw32 acceptance/fips/test/integration/fips/serverspec/fips_spec.rb