diff options
author | Claire McQuin <claire@getchef.com> | 2014-10-29 15:14:22 -0700 |
---|---|---|
committer | Claire McQuin <claire@getchef.com> | 2014-10-29 15:59:04 -0700 |
commit | 5fed7a65a2f024d964ecf2de1bcf2911cf8a600c (patch) | |
tree | 14cc6968e4fe4fd2485c0211088b25c645a80a4b /spec/unit/rest_spec.rb | |
parent | b92c309b0f1aa0837f76ab89d6c81c36076ceca9 (diff) | |
download | chef-5fed7a65a2f024d964ecf2de1bcf2911cf8a600c.tar.gz |
Update to RSpec 3.
Diffstat (limited to 'spec/unit/rest_spec.rb')
-rw-r--r-- | spec/unit/rest_spec.rb | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/spec/unit/rest_spec.rb b/spec/unit/rest_spec.rb index 3047366c47..1aa7ac84ee 100644 --- a/spec/unit/rest_spec.rb +++ b/spec/unit/rest_spec.rb @@ -83,7 +83,7 @@ describe Chef::REST do expect(content_length).not_to be_nil expect(decompressor).not_to be_nil - expect(decompressor < content_length).to be_true + expect(decompressor < content_length).to be_truthy end it "should allow the options hash to be frozen" do @@ -214,7 +214,7 @@ describe Chef::REST do it "indicates that requests should not be signed when it has no credentials" do rest = Chef::REST.new(base_url, nil, nil) - expect(rest.sign_requests?).to be_false + expect(rest.sign_requests?).to be_falsey end it "raises PrivateKeyMissing when the key file doesn't exist" do @@ -462,7 +462,7 @@ describe Chef::REST do end it "should return `false`" do - expect(rest.request(:GET, url)).to be_false + expect(rest.request(:GET, url)).to be_falsey end end @@ -616,10 +616,10 @@ describe Chef::REST do tempfile_path = nil rest.streaming_request(url, {}) do |tempfile| tempfile_path = tempfile.path - expect(File.exist?(tempfile.path)).to be_true + expect(File.exist?(tempfile.path)).to be_truthy expect(IO.read(tempfile.path).chomp).to eq("realultimatepower") end - expect(File.exist?(tempfile_path)).to be_false + expect(File.exist?(tempfile_path)).to be_falsey end it "does not raise a divide by zero exception if the content's actual size is 0" do @@ -648,7 +648,7 @@ describe Chef::REST do tempfile_path = tempfile.path expect(IO.read(tempfile.path).chomp).to eq("realultimatepower") end - expect(File.exist?(tempfile_path)).to be_false + expect(File.exist?(tempfile_path)).to be_falsey end it "closes and unlinks the tempfile if there is an error while streaming the content to the tempfile" do @@ -656,7 +656,7 @@ describe Chef::REST do expect(path).not_to be_nil allow(tempfile).to receive(:write).and_raise(IOError) rest.fetch("cookbooks/a_cookbook") {|tmpfile| "shouldn't get here"} - expect(File.exists?(path)).to be_false + expect(File.exists?(path)).to be_falsey end it "closes and unlinks the tempfile when the response is a redirect" do @@ -683,7 +683,7 @@ describe Chef::REST do rest.fetch("cookbooks/a_cookbook") do |tmpfile| block_called = true end - expect(block_called).to be_true + expect(block_called).to be_truthy end end end @@ -718,15 +718,15 @@ describe Chef::REST do it "does not sign the redirected request when sign_on_redirect is false" do rest.sign_on_redirect = false - rest.follow_redirect { expect(rest.sign_requests?).to be_false } + rest.follow_redirect { expect(rest.sign_requests?).to be_falsey } end it "resets sign_requests to the original value after following an unsigned redirect" do rest.sign_on_redirect = false - expect(rest.sign_requests?).to be_true + expect(rest.sign_requests?).to be_truthy - rest.follow_redirect { expect(rest.sign_requests?).to be_false } - expect(rest.sign_requests?).to be_true + rest.follow_redirect { expect(rest.sign_requests?).to be_falsey } + expect(rest.sign_requests?).to be_truthy end it "configures the redirect limit" do |