Sha256: 31b1d75d59b35c13e0e18bef7c88ad78320521c10ffe1c0ba4ca6010f949f34d

Contents?: true

Size: 750 Bytes

Versions: 1

Compression:

Stored size: 750 Bytes

Contents

# encoding: utf-8

require_relative './test_helper'
require 'vcr'

VCR.configure do |c|
  c.cassette_library_dir = "#{File.dirname(__FILE__)}/fixtures-vcr"
  c.hook_into :webmock
end

class BitlifyTest < Test::Unit::TestCase
  def test_limit_exceeded
    VCR.use_cassette('bitly_limit_exceeded') do
      assert_equal("http://radiospiel.org/foo", Bitly.shorten("http://radiospiel.org/foo"))
    end
  end

  def test_ok
    VCR.use_cassette('bitly_ok') do
      assert_equal("http://bit.ly/HV7woD", Bitly.shorten("http://radiospiel.org/a=1&b=2"))
    end
  end

  def test_url_base
    expected = "https://api-ssl.bitly.com/v3/shorten?login=bitlyapidemo&apiKey=R_0da49e0a9118ff35f52f629d2d71bf07"
    assert_equal expected,  Bitly.url_base
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
radiospieler-0.3.1 test/bitlify_test.rb