Sha256: b039ba78ab0ca75e3cf40618afe623842f12315036b1ed0bd2ba9107f517b3ad

Contents?: true

Size: 673 Bytes

Versions: 4

Compression:

Stored size: 673 Bytes

Contents

require 'test_helper'

class TinyurlTest < Test::Unit::TestCase
  context "Using tinyurl.com" do
    setup do
      FakeWeb.register_uri(:get, "http://tinyurl.com/api-create.php?url=http%3A%2F%2Fgoogle.com", :body => File.join(File.dirname(__FILE__), 'fixtures', 'tinyurl-shorten-google.txt'))
    end
        
    should "return a shortened url (class method)" do
      assert_equal 'http://tinyurl.com/2x6rgl', Shorty::Tinyurl.shorten('http://google.com')
    end
      
    should "return a shortened url (instance method)" do
      @tinyurl = Shorty::Tinyurl.new
      assert_equal 'http://tinyurl.com/2x6rgl', @tinyurl.shorten('http://google.com')
    end
  end  
end

Version data entries

4 entries across 4 versions & 2 rubygems

Version Path
drcapulet-shorty-0.1.0 test/tinyurl_test.rb
drcapulet-shorty-0.1.1 test/tinyurl_test.rb
shorty-0.1.2 test/tinyurl_test.rb
shorty-0.1.1 test/tinyurl_test.rb