diff options
author | Lamont Granquist <lamont@scriptkiddie.org> | 2014-10-24 18:12:50 -0700 |
---|---|---|
committer | Lamont Granquist <lamont@scriptkiddie.org> | 2014-10-24 18:12:50 -0700 |
commit | bd0b0a34e4dbb60fe61bbc8716df90e8f7c7d19a (patch) | |
tree | acc7a2d09b2cec8eed863218c0400cd15cd27854 /spec/unit/provider/template_spec.rb | |
parent | bdce1c5619fde7d277262df9336e06f73e4fc3f8 (diff) | |
download | chef-bd0b0a34e4dbb60fe61bbc8716df90e8f7c7d19a.tar.gz |
updating resources/providers unit tests to rpsec3
mechanically generated patch using transpec 2.3.7 gem
Diffstat (limited to 'spec/unit/provider/template_spec.rb')
-rw-r--r-- | spec/unit/provider/template_spec.rb | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/spec/unit/provider/template_spec.rb b/spec/unit/provider/template_spec.rb index 514bdc12ff..713303d818 100644 --- a/spec/unit/provider/template_spec.rb +++ b/spec/unit/provider/template_spec.rb @@ -39,7 +39,7 @@ describe Chef::Provider::Template do let(:provider) do provider = described_class.new(resource, run_context) - provider.stub(:content).and_return(content) + allow(provider).to receive(:content).and_return(content) provider end @@ -51,7 +51,7 @@ describe Chef::Provider::Template do let(:content) do content = double('Chef::Provider::File::Content::Template', :template_location => "/foo/bar/baz") - File.stub(:exists?).with("/foo/bar/baz").and_return(true) + allow(File).to receive(:exists?).with("/foo/bar/baz").and_return(true) content end @@ -73,15 +73,15 @@ describe Chef::Provider::Template do let(:provider) do provider = described_class.new(resource, run_context) - provider.stub(:content).and_return(content) + allow(provider).to receive(:content).and_return(content) provider end it "stops executing when the local template source can't be found" do setup_normal_file - content.stub(:template_location).and_return("/baz/bar/foo") - File.stub(:exists?).with("/baz/bar/foo").and_return(false) - lambda { provider.run_action(:create) }.should raise_error Chef::Mixin::WhyRun::ResourceRequirements::Assertion::AssertionFailure + allow(content).to receive(:template_location).and_return("/baz/bar/foo") + allow(File).to receive(:exists?).with("/baz/bar/foo").and_return(false) + expect { provider.run_action(:create) }.to raise_error Chef::Mixin::WhyRun::ResourceRequirements::Assertion::AssertionFailure end end |