Sha256: 10db8e0d4f4d9550d38dd71e2994a0d77af82efbbd99600c7328e8c7875f4241

Contents?: true

Size: 1.21 KB

Versions: 3

Compression:

Stored size: 1.21 KB

Contents

require 'lib/muri.rb'

describe "Parse Errors" do
  @no_parser = ["http://media.photobucket.com/image/searchterm/pbapi/file.jpg",
        "http://pic.pbsrc.com/dev_help/WebHelpPublic/PhotobucketPublicHelp.htm"]
  
  @unsupported = ["http://gi0006.photobucket.com/groups/0006/",
                  "http://www.flickr.com/photos",
                  "http://img178.imageshack.us/img178/",
                  "http://img178.imageshack.us/img178/773/",
                  "http://vimeo.com/",
                  "http://vimeo.com/moogaloop.swf?server=vimeo.com&show_title=1&show_byline=1&show_portrait=0&color=&fullscreen=1",
                 "http://vimeo.com/moogaloop.swf?server=vimeo.com&show_title=1&show_byline=1&show_portrait=0&color=&fullscreen=1"]
  
  @no_parser.each do |a|
    it "#{a} should return NoParser" do
      #lambda { Muri.parse a }.should raise_exception(Muri::NoParser)
      m = Muri.parse a
      m.valid? == false
      m.errors == "Muri::NoParser"
    end
  end
  
  @unsupported.each do |b|
    it "#{b} should return UnsupportedURI" do
      #lambda { Muri.parse b }.should raise_exception(Muri::UnsupportedURI)
      m = Muri.parse b
      m.valid? == false
      m.errors == "Muri::UnsupportedURI"
    end
  end
  
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
muri-0.0.7 test/error_test.rb
muri-0.0.6 test/error_test.rb
muri-0.0.5 test/error_test.rb