Skip to content

Commit

Permalink
(maint) Address a few spec failures when running with facter 4
Browse files Browse the repository at this point in the history
  • Loading branch information
melissa committed May 20, 2020
1 parent 3e3d75d commit dc03ea9
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Gem::Specification.new do |s|
s.require_paths = ["lib"]
s.summary = "Puppet, an automated configuration management tool"
s.specification_version = 3
s.add_runtime_dependency(%q<facter>, [">= 2.4.0", "< 4"])
s.add_runtime_dependency(%q<facter>, [">= 2.4.0", "< 5"])
s.add_runtime_dependency(%q<hiera>, [">= 3.2.1", "< 4"])
s.add_runtime_dependency(%q<semantic_puppet>, "~> 1.0")
s.add_runtime_dependency(%q<fast_gettext>, "~> 1.1")
Expand Down
1 change: 1 addition & 0 deletions spec/unit/indirector/catalog/compiler_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -477,6 +477,7 @@ def a_request_that_contains(facts)
end

it "should add 'pe_serverversion' when PE" do
allow(File).to receive(:readable?).and_call_original
allow(File).to receive(:readable?).with(pe_version_file).and_return(true)
allow(File).to receive(:zero?).with(pe_version_file).and_return(false)
allow(File).to receive(:read).and_call_original
Expand Down
1 change: 1 addition & 0 deletions spec/unit/provider/service/init_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@

describe "if the init script is present" do
before :each do
allow(File).to receive(:directory?).and_call_original
allow(File).to receive(:directory?).with("/service/path").and_return(true)
allow(File).to receive(:directory?).with("/alt/service/path").and_return(true)
allow(Puppet::FileSystem).to receive(:exist?).with("/service/path/myservice").and_return(true)
Expand Down
1 change: 1 addition & 0 deletions spec/unit/provider/service/openwrt_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
allow(FileTest).to receive(:executable?).with('/etc/rc.common').and_return(true)

# All OpenWrt tests operate on the init script directly. It must exist.
allow(File).to receive(:directory?).and_call_original
allow(File).to receive(:directory?).with('/etc/init.d').and_return(true)

allow(Puppet::FileSystem).to receive(:exist?).with('/etc/init.d/myservice').and_return(true)
Expand Down

0 comments on commit dc03ea9

Please sign in to comment.