rbrainz 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/LICENSE +25 -0
- data/README +11 -0
- data/Rakefile +110 -0
- data/TODO +24 -0
- data/doc/README.rdoc +68 -0
- data/examples/getartist.rb +54 -0
- data/lib/rbrainz.rb +11 -0
- data/lib/rbrainz/data/countrynames.rb +259 -0
- data/lib/rbrainz/data/languagenames.rb +404 -0
- data/lib/rbrainz/data/scriptnames.rb +64 -0
- data/lib/rbrainz/model.rb +48 -0
- data/lib/rbrainz/model/alias.rb +23 -0
- data/lib/rbrainz/model/artist.rb +54 -0
- data/lib/rbrainz/model/disc.rb +30 -0
- data/lib/rbrainz/model/entity.rb +72 -0
- data/lib/rbrainz/model/incomplete_date.rb +76 -0
- data/lib/rbrainz/model/label.rb +55 -0
- data/lib/rbrainz/model/mbid.rb +82 -0
- data/lib/rbrainz/model/release.rb +50 -0
- data/lib/rbrainz/model/release_event.rb +34 -0
- data/lib/rbrainz/model/track.rb +27 -0
- data/lib/rbrainz/webservice.rb +6 -0
- data/lib/rbrainz/webservice/filter.rb +132 -0
- data/lib/rbrainz/webservice/includes.rb +150 -0
- data/lib/rbrainz/webservice/mbxml.rb +404 -0
- data/lib/rbrainz/webservice/query.rb +61 -0
- data/lib/rbrainz/webservice/webservice.rb +69 -0
- data/test/lib/test_entity.rb +58 -0
- data/test/lib/testing_helper.rb +13 -0
- data/test/test-data/README +13 -0
- data/test/test-data/invalid/artist/basic_1.xml +12 -0
- data/test/test-data/invalid/artist/basic_2.xml +12 -0
- data/test/test-data/invalid/artist/empty_1.xml +0 -0
- data/test/test-data/invalid/artist/empty_2.xml +3 -0
- data/test/test-data/invalid/artist/empty_3.xml +7 -0
- data/test/test-data/invalid/artist/search_result_1.xml +11 -0
- data/test/test-data/valid/artist/Tchaikovsky-1.xml +90 -0
- data/test/test-data/valid/artist/Tori_Amos_1.xml +8 -0
- data/test/test-data/valid/artist/Tori_Amos_2.xml +53 -0
- data/test/test-data/valid/artist/Tori_Amos_3.xml +25 -0
- data/test/test-data/valid/artist/Tori_Amos_4.xml +14 -0
- data/test/test-data/valid/artist/Tori_Amos_5.xml +13 -0
- data/test/test-data/valid/artist/empty_1.xml +7 -0
- data/test/test-data/valid/artist/empty_2.xml +11 -0
- data/test/test-data/valid/artist/search_result_1.xml +19 -0
- data/test/test-data/valid/label/Atlantic_Records_1.xml +9 -0
- data/test/test-data/valid/label/Atlantic_Records_2.xml +11 -0
- data/test/test-data/valid/label/search_result_1.xml +14 -0
- data/test/test-data/valid/release/Highway_61_Revisited_1.xml +68 -0
- data/test/test-data/valid/release/Little_Earthquakes_1.xml +24 -0
- data/test/test-data/valid/release/Little_Earthquakes_2.xml +73 -0
- data/test/test-data/valid/release/Mission_Impossible_2.xml +155 -0
- data/test/test-data/valid/release/Under_the_Pink_1.xml +16 -0
- data/test/test-data/valid/release/Under_the_Pink_2.xml +14 -0
- data/test/test-data/valid/release/Under_the_Pink_3.xml +16 -0
- data/test/test-data/valid/release/search_result_1.xml +29 -0
- data/test/test-data/valid/track/Silent_All_These_Years_1.xml +7 -0
- data/test/test-data/valid/track/Silent_All_These_Years_2.xml +21 -0
- data/test/test-data/valid/track/Silent_All_These_Years_3.xml +16 -0
- data/test/test-data/valid/track/Silent_All_These_Years_4.xml +30 -0
- data/test/test-data/valid/track/Silent_All_These_Years_5.xml +20 -0
- data/test/test-data/valid/track/search_result_1.xml +45 -0
- data/test/test-data/valid/user/User_1.xml +15 -0
- data/test/test_alias.rb +50 -0
- data/test/test_artist.rb +132 -0
- data/test/test_artist_filter.rb +36 -0
- data/test/test_artist_includes.rb +63 -0
- data/test/test_disc.rb +38 -0
- data/test/test_incomplete_date.rb +60 -0
- data/test/test_label.rb +129 -0
- data/test/test_label_filter.rb +36 -0
- data/test/test_label_includes.rb +55 -0
- data/test/test_mbid.rb +99 -0
- data/test/test_mbxml.rb +368 -0
- data/test/test_query.rb +24 -0
- data/test/test_release.rb +161 -0
- data/test/test_release_event.rb +67 -0
- data/test/test_release_filter.rb +57 -0
- data/test/test_release_includes.rb +73 -0
- data/test/test_track.rb +102 -0
- data/test/test_track_filter.rb +57 -0
- data/test/test_track_includes.rb +61 -0
- data/test/test_webservice.rb +23 -0
- metadata +138 -0
@@ -0,0 +1,67 @@
|
|
1
|
+
# $Id$
|
2
|
+
# Copyright (c) 2007, Philipp Wolfer
|
3
|
+
# All rights reserved.
|
4
|
+
# See LICENSE for permissions.
|
5
|
+
|
6
|
+
require 'test/unit'
|
7
|
+
require 'rbrainz/model'
|
8
|
+
include MusicBrainz
|
9
|
+
|
10
|
+
# Unit test for the ReleaseEvent model.
|
11
|
+
class TestReleaseEvent < Test::Unit::TestCase
|
12
|
+
|
13
|
+
def setup
|
14
|
+
end
|
15
|
+
|
16
|
+
def teardown
|
17
|
+
end
|
18
|
+
|
19
|
+
def test_date
|
20
|
+
event = Model::ReleaseEvent.new
|
21
|
+
date = Model::IncompleteDate.new '2007-04-18'
|
22
|
+
assert_nothing_raised {event.date}
|
23
|
+
assert_equal nil, event.date
|
24
|
+
assert_nothing_raised {event.date = date}
|
25
|
+
assert_equal date, event.date
|
26
|
+
|
27
|
+
# It should be able to supply a date as a string,
|
28
|
+
# but EventRelease should convert it to an IncompleteDate.
|
29
|
+
assert_nothing_raised {event.date = '2007-04-20'}
|
30
|
+
assert_equal Model::IncompleteDate.new('2007-04-20'), event.date
|
31
|
+
end
|
32
|
+
|
33
|
+
def test_country
|
34
|
+
event = Model::ReleaseEvent.new
|
35
|
+
assert_nothing_raised {event.country}
|
36
|
+
assert_equal nil, event.country
|
37
|
+
assert_nothing_raised {event.country = 'SE'}
|
38
|
+
assert_equal 'SE', event.country
|
39
|
+
end
|
40
|
+
|
41
|
+
def test_catalog_number
|
42
|
+
event = Model::ReleaseEvent.new
|
43
|
+
assert_nothing_raised {event.catalog_number}
|
44
|
+
assert_equal nil, event.catalog_number
|
45
|
+
assert_nothing_raised {event.catalog_number = 'CM 77615-0'}
|
46
|
+
assert_equal 'CM 77615-0', event.catalog_number
|
47
|
+
end
|
48
|
+
|
49
|
+
def test_barcode
|
50
|
+
event = Model::ReleaseEvent.new
|
51
|
+
assert_nothing_raised {event.barcode}
|
52
|
+
assert_equal nil, event.barcode
|
53
|
+
assert_nothing_raised {event.barcode = '5051099761506'}
|
54
|
+
assert_equal '5051099761506', event.barcode
|
55
|
+
end
|
56
|
+
|
57
|
+
def test_label
|
58
|
+
event = Model::ReleaseEvent.new
|
59
|
+
label = Model::Label.new
|
60
|
+
label.name = 'Century Media'
|
61
|
+
assert_nothing_raised {event.label}
|
62
|
+
assert_equal nil, event.label
|
63
|
+
assert_nothing_raised {event.label = label}
|
64
|
+
assert_equal label, event.label
|
65
|
+
end
|
66
|
+
|
67
|
+
end
|
@@ -0,0 +1,57 @@
|
|
1
|
+
# $Id$
|
2
|
+
# Copyright (c) 2007, Philipp Wolfer
|
3
|
+
# All rights reserved.
|
4
|
+
# See LICENSE for permissions.
|
5
|
+
|
6
|
+
require 'test/unit'
|
7
|
+
require 'testing_helper'
|
8
|
+
require 'rbrainz'
|
9
|
+
include MusicBrainz
|
10
|
+
|
11
|
+
# Unit test for the ReleaseFilter class.
|
12
|
+
class TestReleaseFilter < Test::Unit::TestCase
|
13
|
+
|
14
|
+
def setup
|
15
|
+
@filter_hash = {
|
16
|
+
:title => 'Haven',
|
17
|
+
:discid => 'D5nZLROSPGvr75fj0C72YfowjiQ-',
|
18
|
+
:artist => 'Dark Tranquillity',
|
19
|
+
:artistid => '9d30e408-1559-448b-b491-2f8de1583ccf',
|
20
|
+
:releasetypes => 'Album Official',
|
21
|
+
:count => 12,
|
22
|
+
:date => '2000-07-17',
|
23
|
+
:asin => 'B00004VVW9',
|
24
|
+
:lang => 'ENG',
|
25
|
+
:script => 'Latn',
|
26
|
+
:limit => 10
|
27
|
+
}
|
28
|
+
end
|
29
|
+
|
30
|
+
def teardown
|
31
|
+
end
|
32
|
+
|
33
|
+
def test_filter
|
34
|
+
filter = Webservice::ReleaseFilter.new(@filter_hash)
|
35
|
+
filter_string = filter.to_s
|
36
|
+
assert_not_equal '&', filter_string[0]
|
37
|
+
|
38
|
+
result_hash = query_string_to_hash filter_string
|
39
|
+
assert_equal @filter_hash[:title], result_hash['title'], filter_string
|
40
|
+
assert_equal @filter_hash[:discid], result_hash['discid'], filter_string
|
41
|
+
assert_equal @filter_hash[:artist], result_hash['artist'], filter_string
|
42
|
+
assert_equal @filter_hash[:artistid], result_hash['artistid'], filter_string
|
43
|
+
assert_equal @filter_hash[:releasetypes], result_hash['releasetypes'], filter_string
|
44
|
+
assert_equal @filter_hash[:count].to_s, result_hash['count'], filter_string
|
45
|
+
assert_equal @filter_hash[:date], result_hash['date'], filter_string
|
46
|
+
assert_equal @filter_hash[:asin], result_hash['asin'], filter_string
|
47
|
+
assert_equal @filter_hash[:lang], result_hash['lang'], filter_string
|
48
|
+
assert_equal @filter_hash[:script], result_hash['script'], filter_string
|
49
|
+
assert_equal @filter_hash[:limit].to_s, result_hash['limit'], filter_string
|
50
|
+
end
|
51
|
+
|
52
|
+
def test_empty_filter
|
53
|
+
filter = Webservice::ReleaseFilter.new({})
|
54
|
+
assert_equal '', filter.to_s
|
55
|
+
end
|
56
|
+
|
57
|
+
end
|
@@ -0,0 +1,73 @@
|
|
1
|
+
# $Id$
|
2
|
+
# Copyright (c) 2007, Philipp Wolfer
|
3
|
+
# All rights reserved.
|
4
|
+
# See LICENSE for permissions.
|
5
|
+
|
6
|
+
require 'test/unit'
|
7
|
+
require 'rbrainz'
|
8
|
+
include MusicBrainz
|
9
|
+
|
10
|
+
# Unit test for the ReleaseIncludes class.
|
11
|
+
class TestReleaseIncludes < Test::Unit::TestCase
|
12
|
+
|
13
|
+
def setup
|
14
|
+
end
|
15
|
+
|
16
|
+
def teardown
|
17
|
+
end
|
18
|
+
|
19
|
+
def test_includes
|
20
|
+
includes = Webservice::ReleaseIncludes.new(
|
21
|
+
:artist => true,
|
22
|
+
:counts => true,
|
23
|
+
:release_events => true,
|
24
|
+
:discs => true,
|
25
|
+
:tracks => true,
|
26
|
+
:labels => true,
|
27
|
+
:artist_rels => true,
|
28
|
+
:release_rels => true,
|
29
|
+
:track_rels => true,
|
30
|
+
:label_rels => true,
|
31
|
+
:url_rels => true,
|
32
|
+
:track_level_rels => true
|
33
|
+
)
|
34
|
+
result_string = includes.to_s
|
35
|
+
assert_equal 'inc=', result_string[0..3]
|
36
|
+
|
37
|
+
result_array = result_string[4..-1].split('%20')
|
38
|
+
assert result_array.include?('artist')
|
39
|
+
assert result_array.include?('counts')
|
40
|
+
assert result_array.include?('release-events')
|
41
|
+
assert result_array.include?('discs')
|
42
|
+
assert result_array.include?('tracks')
|
43
|
+
assert result_array.include?('labels')
|
44
|
+
assert result_array.include?('artist-rels')
|
45
|
+
assert result_array.include?('release-rels')
|
46
|
+
assert result_array.include?('track-rels')
|
47
|
+
assert result_array.include?('label-rels')
|
48
|
+
assert result_array.include?('url-rels')
|
49
|
+
assert result_array.include?('track-level-rels')
|
50
|
+
end
|
51
|
+
|
52
|
+
def test_empty_includes
|
53
|
+
includes = Webservice::ReleaseIncludes.new(
|
54
|
+
:artist => false,
|
55
|
+
:counts => false,
|
56
|
+
:release_events => false,
|
57
|
+
:discs => false,
|
58
|
+
:tracks => false,
|
59
|
+
:labels => false,
|
60
|
+
:artist_rels => false,
|
61
|
+
:release_rels => false,
|
62
|
+
:track_rels => false,
|
63
|
+
:label_rels => false,
|
64
|
+
:url_rels => false,
|
65
|
+
:track_level_rels => false
|
66
|
+
)
|
67
|
+
assert_equal '', includes.to_s
|
68
|
+
|
69
|
+
includes = Webservice::ReleaseIncludes.new({})
|
70
|
+
assert_equal '', includes.to_s
|
71
|
+
end
|
72
|
+
|
73
|
+
end
|
data/test/test_track.rb
ADDED
@@ -0,0 +1,102 @@
|
|
1
|
+
# $Id$
|
2
|
+
# Copyright (c) 2007, Philipp Wolfer
|
3
|
+
# All rights reserved.
|
4
|
+
# See LICENSE for permissions.
|
5
|
+
|
6
|
+
require 'test_entity'
|
7
|
+
|
8
|
+
# Unit test for the Track model.
|
9
|
+
class TestTrack < Test::Unit::TestCase
|
10
|
+
|
11
|
+
def setup
|
12
|
+
@tested_class = Model::Track
|
13
|
+
@invalid_entity_types = [:artist, :release, :label]
|
14
|
+
|
15
|
+
@artist = Model::Artist.new
|
16
|
+
@valid_puids = ['9d30e408-1559-448b-b491-2f8de1583ccf',
|
17
|
+
'727ad90b-7ef4-48d2-8f16-c34016544822']
|
18
|
+
@releases = [Model::Release.new, Model::Release.new]
|
19
|
+
end
|
20
|
+
|
21
|
+
def teardown
|
22
|
+
end
|
23
|
+
|
24
|
+
# Include the tests for Entity
|
25
|
+
include TestEntity
|
26
|
+
|
27
|
+
def test_new_track
|
28
|
+
track = nil
|
29
|
+
assert_nothing_raised {track = Model::Track.new}
|
30
|
+
assert track.is_a?(Model::Entity)
|
31
|
+
end
|
32
|
+
|
33
|
+
def test_title
|
34
|
+
track = Model::Track.new
|
35
|
+
assert track.title.nil?
|
36
|
+
assert_nothing_raised {track.title = 'Indifferent Suns'}
|
37
|
+
assert_equal 'Indifferent Suns', track.title
|
38
|
+
end
|
39
|
+
|
40
|
+
# Duration is given in milliseconds.
|
41
|
+
# It must be a positive integer or nil for unknown.
|
42
|
+
def test_duration
|
43
|
+
track = Model::Track.new
|
44
|
+
assert track.duration.nil?
|
45
|
+
assert_nothing_raised {track.duration = 215800}
|
46
|
+
assert_equal 215800, track.duration
|
47
|
+
end
|
48
|
+
|
49
|
+
def test_artist
|
50
|
+
track = Model::Track.new
|
51
|
+
assert track.artist.nil?
|
52
|
+
assert_nothing_raised {track.artist = @artist}
|
53
|
+
assert_equal @artist, track.artist
|
54
|
+
assert_nothing_raised {track.artist = nil}
|
55
|
+
assert_equal nil, track.artist
|
56
|
+
end
|
57
|
+
|
58
|
+
# Many PUIDs can be added
|
59
|
+
def test_add_and_remove_puids
|
60
|
+
track = Model::Track.new
|
61
|
+
assert_equal 0, track.puids.size
|
62
|
+
assert_nothing_raised {track.puids << @valid_puids[0]}
|
63
|
+
assert_equal 1, track.puids.size
|
64
|
+
assert_nothing_raised {track.puids << @valid_puids[1]}
|
65
|
+
assert_equal 2, track.puids.size
|
66
|
+
|
67
|
+
assert_nothing_raised {track.puids.delete @valid_puids[1]}
|
68
|
+
assert_equal 1, track.puids.size
|
69
|
+
assert_nothing_raised {track.puids.delete @valid_puids[0]}
|
70
|
+
assert_equal 0, track.puids.size
|
71
|
+
end
|
72
|
+
|
73
|
+
# You can pass an array of PUIDs to add them all.
|
74
|
+
def test_add_several_puids_at_once
|
75
|
+
track = Model::Track.new
|
76
|
+
assert_nothing_raised {track.puids = @valid_puids}
|
77
|
+
assert_equal @valid_puids, track.puids
|
78
|
+
end
|
79
|
+
|
80
|
+
# Many releases can be added
|
81
|
+
def test_add_and_remove_releases
|
82
|
+
track = Model::Track.new
|
83
|
+
assert_equal 0, track.releases.size
|
84
|
+
assert_nothing_raised {track.releases << @releases[0]}
|
85
|
+
assert_equal 1, track.releases.size
|
86
|
+
assert_nothing_raised {track.releases << @releases[1]}
|
87
|
+
assert_equal 2, track.releases.size
|
88
|
+
|
89
|
+
assert_nothing_raised {track.releases.delete @releases[1]}
|
90
|
+
assert_equal 1, track.releases.size
|
91
|
+
assert_nothing_raised {track.releases.delete @releases[0]}
|
92
|
+
assert_equal 0, track.releases.size
|
93
|
+
end
|
94
|
+
|
95
|
+
# You can pass an array of releases to add them all.
|
96
|
+
def test_add_several_releases_at_once
|
97
|
+
track = Model::Track.new
|
98
|
+
assert_nothing_raised {track.releases = @releases}
|
99
|
+
assert_equal @releases, track.releases
|
100
|
+
end
|
101
|
+
|
102
|
+
end
|
@@ -0,0 +1,57 @@
|
|
1
|
+
# $Id$
|
2
|
+
# Copyright (c) 2007, Philipp Wolfer
|
3
|
+
# All rights reserved.
|
4
|
+
# See LICENSE for permissions.
|
5
|
+
|
6
|
+
require 'test/unit'
|
7
|
+
require 'testing_helper'
|
8
|
+
require 'rbrainz'
|
9
|
+
include MusicBrainz
|
10
|
+
|
11
|
+
# Unit test for the TrackFilter class.
|
12
|
+
class TestTrackFilter < Test::Unit::TestCase
|
13
|
+
|
14
|
+
def setup
|
15
|
+
@filter_hash = {
|
16
|
+
:title => 'The Wonders at Your Feet',
|
17
|
+
:artist => 'Dark Tranquillity',
|
18
|
+
:release => 'Haven',
|
19
|
+
:duration => 1811000,
|
20
|
+
:tracknum => 1,
|
21
|
+
:artistid => '9d30e408-1559-448b-b491-2f8de1583ccf',
|
22
|
+
:releaseid => '0cc5ec17-f52e-42d5-abe8-7b3cdd251e21',
|
23
|
+
:puid => '26d1355d-60b7-0de2-7a57-d01d7ee9e8be',
|
24
|
+
:count => 12,
|
25
|
+
:releasetype => 'Album',
|
26
|
+
:limit => 10
|
27
|
+
}
|
28
|
+
end
|
29
|
+
|
30
|
+
def teardown
|
31
|
+
end
|
32
|
+
|
33
|
+
def test_filter
|
34
|
+
filter = Webservice::TrackFilter.new(@filter_hash)
|
35
|
+
filter_string = filter.to_s
|
36
|
+
assert_not_equal '&', filter_string[0]
|
37
|
+
|
38
|
+
result_hash = query_string_to_hash filter_string
|
39
|
+
assert_equal @filter_hash[:title], result_hash['title'], filter_string
|
40
|
+
assert_equal @filter_hash[:artist], result_hash['artist'], filter_string
|
41
|
+
assert_equal @filter_hash[:release], result_hash['release'], filter_string
|
42
|
+
assert_equal @filter_hash[:duration].to_s, result_hash['duration'], filter_string
|
43
|
+
assert_equal @filter_hash[:tracknum].to_s, result_hash['tracknum'], filter_string
|
44
|
+
assert_equal @filter_hash[:artistid], result_hash['artistid'], filter_string
|
45
|
+
assert_equal @filter_hash[:releaseid], result_hash['releaseid'], filter_string
|
46
|
+
assert_equal @filter_hash[:puid], result_hash['puid'], filter_string
|
47
|
+
assert_equal @filter_hash[:count].to_s, result_hash['count'], filter_string
|
48
|
+
assert_equal @filter_hash[:releasetype], result_hash['releasetype'], filter_string
|
49
|
+
assert_equal @filter_hash[:limit].to_s, result_hash['limit'], filter_string
|
50
|
+
end
|
51
|
+
|
52
|
+
def test_empty_filter
|
53
|
+
filter = Webservice::TrackFilter.new({})
|
54
|
+
assert_equal '', filter.to_s
|
55
|
+
end
|
56
|
+
|
57
|
+
end
|
@@ -0,0 +1,61 @@
|
|
1
|
+
# $Id$
|
2
|
+
# Copyright (c) 2007, Philipp Wolfer
|
3
|
+
# All rights reserved.
|
4
|
+
# See LICENSE for permissions.
|
5
|
+
|
6
|
+
require 'test/unit'
|
7
|
+
require 'rbrainz'
|
8
|
+
include MusicBrainz
|
9
|
+
|
10
|
+
# Unit test for the TrackIncludes class.
|
11
|
+
class TestTrackIncludes < Test::Unit::TestCase
|
12
|
+
|
13
|
+
def setup
|
14
|
+
end
|
15
|
+
|
16
|
+
def teardown
|
17
|
+
end
|
18
|
+
|
19
|
+
def test_includes
|
20
|
+
includes = Webservice::TrackIncludes.new(
|
21
|
+
:artist => true,
|
22
|
+
:releases => true,
|
23
|
+
:puids => true,
|
24
|
+
:artist_rels => true,
|
25
|
+
:release_rels => true,
|
26
|
+
:track_rels => true,
|
27
|
+
:label_rels => true,
|
28
|
+
:url_rels => true
|
29
|
+
)
|
30
|
+
result_string = includes.to_s
|
31
|
+
assert_equal 'inc=', result_string[0..3]
|
32
|
+
|
33
|
+
result_array = result_string[4..-1].split('%20')
|
34
|
+
assert result_array.include?('artist')
|
35
|
+
assert result_array.include?('releases')
|
36
|
+
assert result_array.include?('puids')
|
37
|
+
assert result_array.include?('artist-rels')
|
38
|
+
assert result_array.include?('release-rels')
|
39
|
+
assert result_array.include?('track-rels')
|
40
|
+
assert result_array.include?('label-rels')
|
41
|
+
assert result_array.include?('url-rels')
|
42
|
+
end
|
43
|
+
|
44
|
+
def test_empty_includes
|
45
|
+
includes = Webservice::TrackIncludes.new(
|
46
|
+
:artist => false,
|
47
|
+
:releases => false,
|
48
|
+
:puids => false,
|
49
|
+
:artist_rels => false,
|
50
|
+
:release_rels => false,
|
51
|
+
:track_rels => false,
|
52
|
+
:label_rels => false,
|
53
|
+
:url_rels => false
|
54
|
+
)
|
55
|
+
assert_equal '', includes.to_s
|
56
|
+
|
57
|
+
includes = Webservice::TrackIncludes.new({})
|
58
|
+
assert_equal '', includes.to_s
|
59
|
+
end
|
60
|
+
|
61
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# $Id$
|
2
|
+
# Copyright (c) 2007, Philipp Wolfer
|
3
|
+
# All rights reserved.
|
4
|
+
# See LICENSE for permissions.
|
5
|
+
|
6
|
+
require 'test/unit'
|
7
|
+
require 'rbrainz'
|
8
|
+
include MusicBrainz
|
9
|
+
|
10
|
+
# Unit test for the Webservice class.
|
11
|
+
class TestWebservice < Test::Unit::TestCase
|
12
|
+
|
13
|
+
def setup
|
14
|
+
end
|
15
|
+
|
16
|
+
def teardown
|
17
|
+
end
|
18
|
+
|
19
|
+
def test_not_implemented
|
20
|
+
assert false, 'Unit test for ' + self.class.name + ' not implemented!'
|
21
|
+
end
|
22
|
+
|
23
|
+
end
|