Sha256: d3dc4b4875838aa3cf8b99b14bd378ef2cc1158b47768ca256f5f25c7bcd45e2

Contents?: true

Size: 1.06 KB

Versions: 35

Compression:

Stored size: 1.06 KB

Contents

require File.dirname(__FILE__) + '/../spec_helper'

describe Flickr::Errors, ".error_for" do
  it "should raise a RuntimeError with an \"Internal message\" message if either code or message is blank" do
    lambda { Flickr::Errors.error_for(nil, nil) }.should raise_error(RuntimeError, /^Internal error/)
    lambda { Flickr::Errors.error_for(20, nil) }.should raise_error(RuntimeError, /^Internal error/)
    lambda { Flickr::Errors.error_for(nil, "foo") }.should raise_error(RuntimeError, /^Internal error/)
  end
  
  it "should raise a RuntimeError with an \"Internal error\" message if code is not an integer" do
    lambda { Flickr::Errors.error_for("a", "foo")}.should raise_error(RuntimeError, /^Internal error/)
  end
  
  it "should raise a valid error if parameters are valid" do
    lambda { Flickr::Errors.error_for(96, "Invalid signature")}.should raise_error(Flickr::Error)
  end
  
  it "should return an error with a message starting with the error code" do
    lambda { Flickr::Errors.error_for(97, "Missing signature")}.should raise_error(Flickr::Error, /^97/)
  end
end

Version data entries

35 entries across 35 versions & 11 rubygems

Version Path
fotonauts-flickr_fu-0.3.2 spec/flickr/errors_spec.rb
flickr_fu-0.3.1 spec/flickr/errors_spec.rb
tomk32-flickr_fu-0.3.4.1 spec/flickr/errors_spec.rb
userharmony-flickr_fu-0.3.6 spec/flickr/errors_spec.rb
tomk32-flickr_fu-0.3.3 spec/flickr/errors_spec.rb
tomk32-flickr_fu-0.3.2 spec/flickr/errors_spec.rb
tomk32-flickr_fu-0.3.1 spec/flickr/errors_spec.rb
robsharp-flickr_fu-0.3.0 spec/flickr/errors_spec.rb
mrpunkin-flickr_fu-0.3.0 spec/flickr/errors_spec.rb
flickr_fu-0.3.0 spec/flickr/errors_spec.rb
tomk32-flickr_fu-0.3.0 spec/flickr/errors_spec.rb
rmm5t-flickr_fu-0.3.5 spec/flickr/errors_spec.rb
rmm5t-flickr_fu-0.3.4 spec/flickr/errors_spec.rb
rmm5t-flickr_fu-0.3.3 spec/flickr/errors_spec.rb
rmm5t-flickr_fu-0.3.2 spec/flickr/errors_spec.rb