diff --git a/spec/auth_token_spec.rb b/spec/auth_token_spec.rb index f9358051..17c7fa4c 100644 --- a/spec/auth_token_spec.rb +++ b/spec/auth_token_spec.rb @@ -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 diff --git a/spec/cloudinary_helper_spec.rb b/spec/cloudinary_helper_spec.rb index 32ebb905..5d653d60 100644 --- a/spec/cloudinary_helper_spec.rb +++ b/spec/cloudinary_helper_spec.rb @@ -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 @@ -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")