<commit_before>require 'spof'
require 'test/unit'

class TestBasicWrapper < Test::Unit::TestCase

  def setup
    @w = Spof::Wrapper.new :testing => false # testing actual responses!
  end

  def test_search_album_response
    expected = Spof::Search.album('space oddity')[:albums]
    real = @w.album.search('space oddity')
    assert_equal expected, real
  end

  def test_search_artist_response
    expected = Spof::Search.artist('<NAME>')[:artists]
    real = @w.artist.search('<NAME>')
    assert_equal expected, real
  end

  def test_search_track_response
    expected = Spof::Search.track('life on mars')[:tracks]
    real = @w.track.search('life on mars')
    assert_equal expected, real
  end

end<commit_msg>Add test for Spof::Wrapper#all (failing)<commit_after>require 'spof'
require 'test/unit'

class TestBasicWrapper < Test::Unit::TestCase

  def setup
    @w = Spof::Wrapper.new :testing => false # testing actual responses!
  end

  def test_search_album_response
    expected = Spof::Search.album('space oddity')[:albums]
    real = @w.album.search('space oddity')
    assert_equal expected, real
  end

  def test_search_artist_response
    expected = Spof::Search.artist('<NAME>')[:artists]
    real = @w.artist.search('<NAME>')
    assert_equal expected, real
  end

  def test_search_track_response
    expected = Spof::Search.track('life on mars')[:tracks]
    real = @w.track.search('life on mars')
    assert_equal expected, real
  end

  def test_all_search_response
    expected = []
    page = 0
    loop do
      res = Spof::Search.album('nine inch nails', page)[:albums]
      page += 1
      expected |= res
      break if res.empty?
    end
    real = @w.album.all.search('nine inch nails')
    assert_equal expected, real
  end

end
{'fraction_non_alphanumeric': 0.11954674220963173, 'fraction_numerical': 0.0011331444759206798, 'mean_word_length': 3.772972972972973, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '908754', 'n_tokens_mistral': 576, 'n_tokens_neox': 559, 'n_words': 139}