Skip to content

Commit

Permalink
Suppress warnings in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Amir Tocker committed Jan 29, 2018
1 parent cdd79aa commit f99a8a0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions spec/auth_token_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,11 @@
it "should raise if key is not provided" do
Cloudinary.config.auth_token[:key] = nil
token = { :expiration => 111111, :duration => 0 }
expect{Cloudinary::Utils.generate_auth_token(token)}.to raise_error
expect{Cloudinary::Utils.generate_auth_token(token)}.to raise_error(/Missing auth token key configuration/)
end
it "should raise if expiration and duration are not provided" do
token = { :key => KEY, :expiration => 0, :duration => 0 }
expect{Cloudinary::Utils.generate_auth_token(token)}.to raise_error
expect{Cloudinary::Utils.generate_auth_token(token)}.to raise_error(/Must provide either expiration or duration/)
end
end
describe "authentication token" do
Expand Down
4 changes: 2 additions & 2 deletions spec/cloudinary_helper_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ def reset_metadata

after :each do
Cloudinary.config.static_image_support = @static_support
Cloudinary::Static::METADATA_FILE = @static_file
Kernel::silence_warnings { Cloudinary::Static::METADATA_FILE = @static_file }
Cloudinary::Static.reset_metadata
end

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

0 comments on commit f99a8a0

Please sign in to comment.