Sha256: 1b4758b7f90d9e70248b854cb440d0ac07c91dc73e8abfda9b5c9ebe7a194d9f

Contents?: true

Size: 647 Bytes

Versions: 3

Compression:

Stored size: 647 Bytes

Contents

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 have_autolinked_url(url)}
    end
  end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
twitter-text-1.0.4 spec/regex_spec.rb
twitter-text-1.0.3 spec/regex_spec.rb
twitter-text-1.0.2 spec/regex_spec.rb