## How they relate beaker is an acceptance testing program that is written Ruby. beaker-rspec is a combination of the [beaker DSL](http://www.rubydoc.info/github/puppetlabs/beaker/Beaker/DSL) (domain specific language) with [RSpec](http://rspec.info/) (a spec test format) and [Serverspec](http://serverspec.org/) (an extension to RSpec that provides many useful matchers). ![beaker vs. beaker-rspec (venn)](http://anodelman.github.io/shared/img/beaker_vs_beaker_rspec.jpg) ## beaker * can provision and configure test hosts * tests are just Ruby files * tests are considered to have passed if they execute all the way through without errors/exceptions * tests can also use asserts to explicitly enforce a state * tests written in Ruby with Beaker data specific language extensions ### An example beaker test ### test_name "Be able to execute multi-line commands (#9996)" confine :except, :platform => 'windows' agents.each do |agent| temp_file_name = agent.tmpfile('9996-multi-line-commands') test_manifest = < "/bin/echo '#Test' > #{temp_file_name}; /bin/echo 'bob' >> #{temp_file_name};" } HERE expected_results = < UNSUPPORTED_PLATFORMS.include?(fact('osfamily')) do it 'sets up ntp.conf' do apply_manifest(%{ class { 'ntp': } }, :catch_failures => true) end describe file("#{config}") do it { should be_file } its(:content) { should match line } end end ## How to choose? * beaker-rspec is intended for use as a module testing tool. * beaker is used for all other testing (puppet, puppetDB, Puppet Enterprise, etc).