Class: Jabber::UserTune::TuneTest
- Inherits:
-
Test::Unit::TestCase
- Object
- Test::Unit::TestCase
- Jabber::UserTune::TuneTest
- Defined in:
- lib/gems/xmpp4r-0.4/test/tune/tc_tune.rb
Instance Method Summary collapse
- #artist ⇒ Object
- #length ⇒ Object
- #rating ⇒ Object
- #source ⇒ Object
- #test_create ⇒ Object
- #test_rating_edgecases ⇒ Object
- #test_stop_playing ⇒ Object
- #title ⇒ Object
- #track ⇒ Object
- #uri ⇒ Object
Methods inherited from Test::Unit::TestCase
#assert_array_equal, expect, #run
Instance Method Details
#artist ⇒ Object
52 53 54 |
# File 'lib/gems/xmpp4r-0.4/test/tune/tc_tune.rb', line 52 def artist 'Mike Flowers Pops' end |
#length ⇒ Object
60 61 62 |
# File 'lib/gems/xmpp4r-0.4/test/tune/tc_tune.rb', line 60 def length 175 end |
#rating ⇒ Object
76 77 78 |
# File 'lib/gems/xmpp4r-0.4/test/tune/tc_tune.rb', line 76 def 10 end |
#source ⇒ Object
68 69 70 |
# File 'lib/gems/xmpp4r-0.4/test/tune/tc_tune.rb', line 68 def source 'A Groovy Place' end |
#test_create ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/gems/xmpp4r-0.4/test/tune/tc_tune.rb', line 9 def test_create artist='Mike Flowers Pops' title='Light My Fire' length=175 track='4' source='A Groovy Place' uri='http://musicbrainz.org/track/d44110e6-4b20-4d16-9e69-74bf0e4f7106.html' =10 t=Jabber::UserTune::Tune.new(artist,title,length,track,source,uri,) assert_kind_of Jabber::UserTune::Tune,t assert_equal 7,t.elements.size assert_equal true,t. assert_equal artist,t.artist assert_equal track,t.track assert_equal length,t.length assert_equal track,t.track assert_equal source,t.source assert_equal uri,t.uri assert_equal ,t. end |
#test_rating_edgecases ⇒ Object
46 47 48 49 50 |
# File 'lib/gems/xmpp4r-0.4/test/tune/tc_tune.rb', line 46 def assert_equal(0, Jabber::UserTune::Tune.new(artist,title,length,track,source,uri,-1.5).) assert_equal(10, Jabber::UserTune::Tune.new(artist,title,length,track,source,uri,11.5).) assert_equal(nil, Jabber::UserTune::Tune.new(artist,title,length,track,source,uri,'fantastic').) end |
#test_stop_playing ⇒ Object
32 33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/gems/xmpp4r-0.4/test/tune/tc_tune.rb', line 32 def t=Jabber::UserTune::Tune.new assert_kind_of Jabber::UserTune::Tune,t assert_equal 0,t.elements.size assert_equal false, t. assert_equal nil,t.artist assert_equal nil,t.track assert_equal nil,t.length assert_equal nil,t.track assert_equal nil,t.source assert_equal nil,t.uri end |
#title ⇒ Object
56 57 58 |
# File 'lib/gems/xmpp4r-0.4/test/tune/tc_tune.rb', line 56 def title 'Light My Fire' end |
#track ⇒ Object
64 65 66 |
# File 'lib/gems/xmpp4r-0.4/test/tune/tc_tune.rb', line 64 def track '4' end |
#uri ⇒ Object
72 73 74 |
# File 'lib/gems/xmpp4r-0.4/test/tune/tc_tune.rb', line 72 def uri 'http://musicbrainz.org/track/d44110e6-4b20-4d16-9e69-74bf0e4f7106.html' end |