Sha256: b2c6f04d2686916cdbf76044d7663924242ee691f47f6c4a03c4f60a14dbe77d

Contents?: true

Size: 665 Bytes

Versions: 1

Compression:

Stored size: 665 Bytes

Contents

#encoding: UTF-8
require File.dirname(__FILE__) + '/spec_helper'

describe "Twitter::Regex regular expressions" do
  describe "matching URLS" do
    TestUrls::VALID.each do |url|
      it "should match the URL #{url}" do
        url.should match_autolink_expression
      end

      it "should match the URL #{url} when it's embedded in other text" do
        text = "Sweet url: #{url} I found. #awesome"
        url.should match_autolink_expression_in(text)
      end
    end
  end

  describe "invalid URLS" do
    it "does not link urls with invalid characters" do
      TestUrls::INVALID.each {|url| url.should_not match_autolink_expression}
    end
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
twitter-text-1.1.4 spec/regex_spec.rb