spec/00_configuration_spec.rb in nagira-0.3.3 vs spec/00_configuration_spec.rb in nagira-0.4.0

- old
+ new

@@ -1,60 +1,60 @@ require 'spec_helper' -describe "Configuration" do +describe "Configuration" do set :environment, ENV['RACK_ENV'] || :test - before { + before { @cfg = Nagios::Config.new(Nagira.settings.nagios_cfg) } context "nagios.cfg" do - it { File.should exist @cfg.path } - + it { expect(File).to exist(@cfg.path) } + it "should be parseable" do - lambda { @cfg.parse }.should_not raise_error + expect { @cfg.parse }.not_to raise_error end - context "parsing nagios.cfg file" do + context "parsing nagios.cfg file" do before { @cfg.parse } - - it "should have PATH to objects file" do - @cfg.object_cache_file.should be_a_kind_of String + + it "should have PATH to objects file" do + expect(@cfg.object_cache_file).to be_a_kind_of String end - + it "should have PATH to status file" do - @cfg.status_file.should be_a_kind_of String + expect(@cfg.status_file).to be_a_kind_of String end end # parsing nagios.cfg file end # nagios.cfg - - context "data files" do + + context "data files" do before { @cfg.parse } - + context Nagios::Status do - + subject { Nagios::Status.new( Nagira.settings.status_cfg || @cfg.status_file ) } - it { File.should exist( subject.path ) } - + it { expect(File).to exist( subject.path ) } + it "should be parseable" do - lambda { subject.parse }.should_not raise_error + expect { subject.parse }.not_to raise_error end end # Nagios::Status context Nagios::Objects do subject { Nagios::Objects.new( Nagira.settings.objects_cfg || @cfg.object_cache_file) } - it { File.should exist subject.path } - + it { expect(File).to exist(subject.path) } + it "should be parseable" do - lambda { subject.parse }.should_not raise_error + expect { subject.parse }.not_to raise_error end end # Nagios::Objects end # data files