summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Parker <andy@puppetlabs.com>2014-09-09 13:07:35 -0700
committerAndrew Parker <andy@puppetlabs.com>2014-09-09 13:07:35 -0700
commitc12c206c4c7fe5273b58c48d4266494ea2ee846b (patch)
treea980d84eb24c7c0183ae88a44d1624263da4fd43
parent7a0a93701b42ce200baa5e5124bdbca506d38e23 (diff)
downloadpuppet-c12c206c4c7fe5273b58c48d4266494ea2ee846b.tar.gz
(maint) Cleanup test to be more readable
The formatting was a little off, which made it hard to see what code was in the test. This fixes the formatting and uses the resource matcher so that it can provide a better error message.
-rwxr-xr-xspec/unit/settings_spec.rb9
1 files changed, 7 insertions, 2 deletions
diff --git a/spec/unit/settings_spec.rb b/spec/unit/settings_spec.rb
index c0cd9e0aa..92478d5c4 100755
--- a/spec/unit/settings_spec.rb
+++ b/spec/unit/settings_spec.rb
@@ -2,9 +2,12 @@
require 'spec_helper'
require 'ostruct'
require 'puppet/settings/errors'
+require 'puppet_spec/files'
+require 'matchers/resource'
describe Puppet::Settings do
include PuppetSpec::Files
+ include Matchers::Resource
let(:main_config_file_default_location) do
File.join(Puppet::Util::RunMode[:master].conf_dir, "puppet.conf")
@@ -1342,8 +1345,10 @@ describe Puppet::Settings do
@settings.define_settings :main,
:manifestdir => { :type => :directory, :default => @prefix+"/manifestdir", :desc => "a" },
:environmentpath => { :type => :path, :default => @prefix+"/envs", :desc => "a" }
- catalog = @settings.to_catalog(:main)
- catalog.resource(:file, @prefix+"/manifestdir").should be_nil
+
+ catalog = @settings.to_catalog(:main)
+
+ expect(catalog).to_not have_resource("File[#{@prefix}/manifestdir]")
end
describe "on Microsoft Windows" do