vvchik / vagrant-serverspec

Vagrant plugin that integrates serverspec
MIT License
191 stars 28 forks source link

Error: You must list at least one spec file #26

Closed neilhwatson closed 8 years ago

neilhwatson commented 8 years ago

I think the documentation is missing a step. Perhaps how Vagrant finds the serverspec files.

$ tail Vagrantfile 
  config.vm.provision "ansible" do |ansible|
     ansible.verbose = 'v'
     ansible.playbook = "solr.yml"
  end

  config.vm.provision "serverspec" do |spec|
     spec.pattern = '*_spec.rb'
  end

end

$ find spec/
spec/
spec/default
spec/default/sample_spec.rb
spec/spec_helper.rb

$ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
There are errors in the configuration of this machine. Please fix
the following errors and try again:

serverspec provisioner:
* You must list at least one spec file

What is missing?

neilhwatson commented 8 years ago

Turns out the search pattern is not recursive and serverspec defaults to a directory tree, so the example should show:

  config.vm.provision "serverspec" do |spec|
     spec.pattern = 'spec/default/*_spec.rb'
  end