Sha256: 7c795ff277acf6b5231306a1ca81ea4ae42c9517b6ccd3d55dd651287bb0b1da

Contents?: true

Size: 1002 Bytes

Versions: 4

Compression:

Stored size: 1002 Bytes

Contents

require 'helper'
require 'yaml'

class TestNextBigSound < Test::Unit::TestCase
  include NBS
  context "Has Valid api key" do 
    setup do 
      # get the api key from the yaml file
      YAML.load_file("./test/credentials.yml").each { |key,value| instance_variable_set("@#{key}", value) }
      @nbs = Base.new(@api_key)
    end
  	context "Assuming we are able to search for the killers" do 
	    setup do 
         @searchobj = @nbs.search("The Killers")
      end
	    should "Be able to find The Killers ArtistID" do
        assert_match /<artist id=\"\d+\">/i, @searchobj.to_xml
    	end
    	should "have an array of results" do 
  	    assert !@searchobj.artists.empty?
  	  end
  	  should "have first result with artist name of The Killers" do 
	      assert_equal "The Killers", @searchobj.artists.first.name
	    end
	    should "metrics for profile" do
	      assert @searchobj.artists.first.profiles["MYSPACE"].is_a?(ArtistProfile)
      end
	  end
    #should "have many re"
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
next-big-sound-0.8.2 test/test_search.rb
next-big-sound-0.8.1 test/test_search.rb
next-big-sound-0.8.0 test/test_search.rb
next-big-sound-0.7.0 test/test_search.rb