Skip to content

Commit f99a8a0

Browse files
author
Amir Tocker
committed
Suppress warnings in tests
1 parent cdd79aa commit f99a8a0

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

spec/auth_token_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,11 @@
5858
it "should raise if key is not provided" do
5959
Cloudinary.config.auth_token[:key] = nil
6060
token = { :expiration => 111111, :duration => 0 }
61-
expect{Cloudinary::Utils.generate_auth_token(token)}.to raise_error
61+
expect{Cloudinary::Utils.generate_auth_token(token)}.to raise_error(/Missing auth token key configuration/)
6262
end
6363
it "should raise if expiration and duration are not provided" do
6464
token = { :key => KEY, :expiration => 0, :duration => 0 }
65-
expect{Cloudinary::Utils.generate_auth_token(token)}.to raise_error
65+
expect{Cloudinary::Utils.generate_auth_token(token)}.to raise_error(/Must provide either expiration or duration/)
6666
end
6767
end
6868
describe "authentication token" do

spec/cloudinary_helper_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ def reset_metadata
163163

164164
after :each do
165165
Cloudinary.config.static_image_support = @static_support
166-
Cloudinary::Static::METADATA_FILE = @static_file
166+
Kernel::silence_warnings { Cloudinary::Static::METADATA_FILE = @static_file }
167167
Cloudinary::Static.reset_metadata
168168
end
169169

@@ -175,7 +175,7 @@ def reset_metadata
175175
Cloudinary.config.static_image_support = false
176176
expect(helper.image_path('/images/foo.jpg')).to eq('/images/foo.jpg')
177177
expect(helper.image_path('some-folder/foo.gif')).to eq("/images/some-folder/foo.gif")
178-
Cloudinary::Static::METADATA_FILE = "spec/sample_asset_file.tsv"
178+
Kernel::silence_warnings { Cloudinary::Static::METADATA_FILE = "spec/sample_asset_file.tsv"}
179179
Cloudinary::Static.reset_metadata
180180
expect(helper.image_path('/images/foo.jpg'))
181181
.to eq("/images/foo.jpg")

0 commit comments

Comments
 (0)