projects
/
mirror
/
dsa-puppet.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Update puppetlabs/stdlib module
[mirror/dsa-puppet.git]
/
3rdparty
/
modules
/
stdlib
/
spec
/
unit
/
facter
/
util
/
puppet_settings_spec.rb
diff --git
a/3rdparty/modules/stdlib/spec/unit/facter/util/puppet_settings_spec.rb
b/3rdparty/modules/stdlib/spec/unit/facter/util/puppet_settings_spec.rb
old mode 100755
(executable)
new mode 100644
(file)
index
c278b79
..
05dff89
--- a/
3rdparty/modules/stdlib/spec/unit/facter/util/puppet_settings_spec.rb
+++ b/
3rdparty/modules/stdlib/spec/unit/facter/util/puppet_settings_spec.rb
@@
-1,35
+1,34
@@
-#! /usr/bin/env ruby -S rspec
require 'spec_helper'
require 'facter/util/puppet_settings'
describe Facter::Util::PuppetSettings do
require 'spec_helper'
require 'facter/util/puppet_settings'
describe Facter::Util::PuppetSettings do
-
- describe "#with_puppet" do
- context "Without Puppet loaded" do
+ describe '#with_puppet' do
+ context 'without Puppet loaded' do
before(:each) do
before(:each) do
-
Module.expects(:const_get).with("Puppet").raises
(NameError)
+
allow(Module).to receive(:const_get).with('Puppet').and_raise
(NameError)
end
end
- it '
should be
nil' do
+ it '
is
nil' do
expect(subject.with_puppet { Puppet[:vardir] }).to be_nil
end
expect(subject.with_puppet { Puppet[:vardir] }).to be_nil
end
- it '
should
not yield to the block' do
-
Puppet.expects
(:[]).never
+ it '
does
not yield to the block' do
+
expect(Puppet).to receive
(:[]).never
expect(subject.with_puppet { Puppet[:vardir] }).to be_nil
end
end
expect(subject.with_puppet { Puppet[:vardir] }).to be_nil
end
end
- context "With Puppet loaded" do
+ context 'with Puppet loaded' do
+ # module Puppet
module Puppet; end
module Puppet; end
- let(:vardir) {
"/var/lib/puppet"
}
+ let(:vardir) {
'/var/lib/puppet'
}
before :each do
before :each do
- Puppet.expects(:[]).with(:vardir).returns vardir
+ allow(Puppet).to receive(:[]).with(:vardir).and_return(vardir)
end
end
- it '
should yield
to the block' do
+ it '
yields
to the block' do
subject.with_puppet { Puppet[:vardir] }
end
subject.with_puppet { Puppet[:vardir] }
end
- it '
should return
the nodes vardir' do
+ it '
returns
the nodes vardir' do
expect(subject.with_puppet { Puppet[:vardir] }).to eq vardir
end
end
expect(subject.with_puppet { Puppet[:vardir] }).to eq vardir
end
end