Sha256: 351dd8965437b537c197d16a61b48d41fde0832046f5e9c791f08c4f3421dd37

Contents?: true

Size: 626 Bytes

Versions: 4

Compression:

Stored size: 626 Bytes

Contents

require 'test_helper'

class IsgdTest < Test::Unit::TestCase
  context "Using is.gd" do
    setup do
      FakeWeb.register_uri(:get, "http://is.gd/api.php?longurl=http%3A%2F%2Fgoogle.com", :body => File.join(File.dirname(__FILE__), 'fixtures', 'isgd-shorten-google.txt'))
    end
        
    should "return a shortened url (class method)" do
      assert_equal 'http://is.gd/2iE2G', Shorty::Isgd.shorten('http://google.com')
    end   
    
    should "return a shortened url (instance method)" do
      @isgd = Shorty::Isgd.new
      assert_equal 'http://is.gd/2iE2G', @isgd.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/isgd_test.rb
drcapulet-shorty-0.1.1 test/isgd_test.rb
shorty-0.1.2 test/isgd_test.rb
shorty-0.1.1 test/isgd_test.rb