diff options
| author | Gheorghe Popescu <gheorghe.popescu@puppet.com> | 2021-03-12 09:04:42 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-03-12 09:04:42 +0200 |
| commit | ad33a665542a84f0c312dd255fa726f03d5826c7 (patch) | |
| tree | 4c3e8d9b1dffc341b346d5013aef29faa21bf161 /spec/unit | |
| parent | f93d4b33c0a7147346909260ee10129090c1714a (diff) | |
| parent | 98ef1e0e34c86bcc11e44a6902b74f52d648bb56 (diff) | |
| download | puppet-hosts_core-ad33a665542a84f0c312dd255fa726f03d5826c7.tar.gz puppet-hosts_core-ad33a665542a84f0c312dd255fa726f03d5826c7.tar.bz2 | |
Merge pull request #28 from GabrielNagy/MODULES-10953/update-metadata
Diffstat (limited to 'spec/unit')
| -rw-r--r-- | spec/unit/provider/host/parsed_spec.rb | 8 | ||||
| -rw-r--r-- | spec/unit/type/host_spec.rb | 4 |
2 files changed, 6 insertions, 6 deletions
diff --git a/spec/unit/provider/host/parsed_spec.rb b/spec/unit/provider/host/parsed_spec.rb index e07c83d..32e8b44 100644 --- a/spec/unit/provider/host/parsed_spec.rb +++ b/spec/unit/provider/host/parsed_spec.rb @@ -29,10 +29,10 @@ describe Puppet::Type.type(:host).provider(:parsed) do end def genhost(host) - provider.stubs(:filetype).returns(Puppet::Util::FileType::FileTypeRam) - File.stubs(:chown) - File.stubs(:chmod) - Puppet::Util::SUIDManager.stubs(:asuser).yields + allow(provider).to receive(:filetype).and_return(Puppet::Util::FileType::FileTypeRam) + allow(File).to receive(:chown) + allow(File).to receive(:chmod) + allow(Puppet::Util::SUIDManager).to receive(:asuser).and_yield host.flush provider.target_object(hostfile).read end diff --git a/spec/unit/type/host_spec.rb b/spec/unit/type/host_spec.rb index 426657a..54d9b75 100644 --- a/spec/unit/type/host_spec.rb +++ b/spec/unit/type/host_spec.rb @@ -4,7 +4,7 @@ FakeHostProvider = Struct.new(:ip, :host_aliases, :comment) describe Puppet::Type.type(:host) do let(:provider) { FakeHostProvider.new } - let(:resource) { stub('resource', resource: nil, provider: provider) } + let(:resource) { instance_double('Puppet::Type::Host', provider: provider) } it 'has :name be its namevar' do expect(described_class.key_attributes).to eq([:name]) @@ -645,7 +645,7 @@ describe Puppet::Type.type(:host) do it 'alsoes use the specified delimiter for joining' do host_aliases = described_class.attrclass(:host_aliases).new(resource: resource, should: ['foo', 'bar']) - host_aliases.stubs(:delimiter).returns "\t" + allow(host_aliases).to receive(:delimiter).and_return "\t" host_aliases.sync expect(provider.host_aliases).to eq("foo\tbar") |
