Sha256: 5ddec45d9e02f603602297760bc399f2c6093a3f23380c0af46dad6bae64a449

Contents?: true

Size: 1.07 KB

Versions: 4

Compression:

Stored size: 1.07 KB

Contents

require 'helper'

class TestRemote < Test::Unit::TestCase
  context "Given a remote with no api key" do
    should "raise an APIKeyNotSet exception when created with no key" do
      assert_raise APIKeyNotSet do
        @remote = Songkickr::Remote.new
      end
    end
  end
  
# TODO: Fix this later
  context "Given a remote with an invalid api key" do
    setup do
      stub_get('http://api.songkick.com/api/3.0/events.json', 'events.json')
      @remote = Songkickr::Remote.new 'omgwtfbbq_fake_key'
    end
    
    should "generate a remote" do
      assert_not_nil @remote
    end
    
    # to make it work it needs:
    # 1) registering GET http://api.songkick.com/api/3.0/events.json?apikey=omgwtfbbq_fake_key
    #    and its variants with fakeweb OR allowing real http connections
    # 2) checking that returned json equals fixtures/invalid_api_key.json
    # 
    #should "generate nil results" do
    #  [{}, ':artist_name => ""', ':artist_name => "Madonna"'].each do |remote_params|
    #    assert_nil @remote.send(:events, remote_params).results
    #  end
    #end
  end
  
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
songkickr-0.2.1 test/songkickr/test_remote.rb
songkickr-0.2.0 test/songkickr/test_remote.rb
songkickr-0.1.4 test/songkickr/test_remote.rb
songkickr-0.1.3 test/songkickr/test_remote.rb