# Use Travis's cointainer based infrastructure
sudo: false
addons:
  apt:
    sources:
      - chef-current-precise
    packages:
      - chefdk

# We are still doing bundle install since we want to use the
# master of mixlib-install until it gets a full release.
install:
  - eval "$(/opt/chefdk/bin/chef shell-init bash)"
  - bundle install

branches:
  only:
    - master

# Ensure we make ChefDK's Ruby the default
before_script:
  - eval "$(/opt/chefdk/bin/chef shell-init bash)"
  - /opt/chefdk/embedded/bin/chef gem install chef-sugar
  - /opt/chefdk/embedded/bin/chef gem install mixlib-versioning
  - /opt/chefdk/embedded/bin/chef gem install mixlib-install --pre
script:
  - /opt/chefdk/embedded/bin/chef --version
  - /opt/chefdk/embedded/bin/rubocop --version
  - /opt/chefdk/embedded/bin/rubocop
  - /opt/chefdk/embedded/bin/foodcritic --version
  - /opt/chefdk/embedded/bin/foodcritic . --exclude spec
  - bundle exec rspec spec

language: ruby
cache: bundler

# Use Travis's cointainer based infrastructure
sudo: false
addons:
  apt:
    sources:
      - chef-current-precise
    packages:
      - chefdk

# We are still doing bundle install since we want to use the
# master of mixlib-install until it gets a full release.
install:
  - eval "$(/opt/chefdk/bin/chef shell-init bash)"
  - bundle install

branches:
  only:
    - master

# make sure we have the latest version of bunder required by ohai which
# fauxhai depends on which chefspec depends on
before_install:
  - gem update --system
  - gem install bundler
  - bundle --version
  - gem --version

# Ensure we make ChefDK's Ruby the default
before_script:
  - eval "$(/opt/chefdk/bin/chef shell-init bash)"
  - /opt/chefdk/embedded/bin/chef gem install chef-sugar
  - /opt/chefdk/embedded/bin/chef gem install mixlib-versioning
  - /opt/chefdk/embedded/bin/chef gem install mixlib-install --pre
script:
  - /opt/chefdk/embedded/bin/chef --version
  - /opt/chefdk/embedded/bin/rubocop --version
  - /opt/chefdk/embedded/bin/rubocop
  - /opt/chefdk/embedded/bin/foodcritic --version
  - /opt/chefdk/embedded/bin/foodcritic . --exclude spec
  - bundle exec rspec spec

Install the version of bundler required by the latest ohai
Install the version of bundler required by the latest ohai

The need for this should be avoided altogether, but this fixes travis
