spec/onceover/controlrepo_spec.rb in onceover-3.2.4 vs spec/onceover/controlrepo_spec.rb in onceover-3.2.5

- old
+ new

@@ -1,18 +1,51 @@ require 'spec_helper' require 'onceover/controlrepo' describe "Onceover::Controlrepo" do - before do - @repo = Onceover::Controlrepo.new( - { - path:'spec/fixtures/controlrepo' - } - ) - end + context "in a barebones controlrepo" do + before do + @repo = Onceover::Controlrepo.new( + { + path:'spec/fixtures/controlrepo_basic' + } + ) + end - context ".hiera_config_file_relative_path" do context "without hiera.yaml" do it { expect(@repo.hiera_config_file_relative_path).to be_nil } + end + end + + context "in a complex repo" do + before do + @repo = Onceover::Controlrepo.new( + { + path:'spec/fixtures/puppet_controlrepo' + } + ) + end + + context "when initialising the object" do + it { expect(@repo).not_to be_nil } + end + + context "when running the tests" do + it "doesn't die horribly" do + expect{ + Dir.chdir('spec/fixtures/puppet_controlrepo') do + require 'onceover/controlrepo' + require 'onceover/cli' + require 'onceover/runner' + require 'onceover/testconfig' + require 'onceover/logger' + + repo = Onceover::Controlrepo.new({}) + runner = Onceover::Runner.new(repo,Onceover::TestConfig.new(repo.onceover_yaml, {}), :spec) + runner.prepare! + runner.run_spec! + end + }.not_to raise_error + end end end end