Class | TestSnarl |
In: |
test/test_snarl.rb
|
Parent: | Test::Unit::TestCase |
require ‘test/unit’ unless defined? $ZENTEST and $ZENTEST
# File test/test_snarl.rb, line 6 6: def test_new_api 7: assert(Snarl.new('title')) 8: assert(Snarl.new('title', 'msg')) 9: 10: assert_raises(TypeError) { Snarl.new('title', 'msg', 0) } 11: assert(Snarl.new('title', 'msg', nil)) 12: assert(Snarl.new('title', 'msg', 'missing_file')) 13: assert(Snarl.new('title', 'short', nil, 1)) 14: end
# File test/test_snarl.rb, line 16 16: def test_show_api 17: assert(Snarl.show_message('title')) 18: assert(Snarl.show_message('title', 'msg')) 19: 20: assert_raises(TypeError) { Snarl.show_message('title', 'msg', 0) } 21: assert(Snarl.show_message('title', 'msg', nil)) 22: assert(Snarl.show_message('title', 'msg', 'missing_file')) 23: assert(Snarl.show_message('title', 'short', nil, 1)) 24: end
# File test/test_snarl.rb, line 26 26: def test_update_api 27: assert(s = Snarl.new('title')) 28: assert(s.update('new title')) 29: assert(s.update('title', 'msg')) 30: 31: assert_raises(TypeError) { s.update('title', 'msg', 0) } 32: assert(s.update('title', 'msg', nil)) 33: assert(s.update('title', 'msg', 'missing_file')) 34: assert(s.update('title', 'short', nil, 1)) 35: end
this one is a little fragile, but it passes right now…
# File test/test_snarl.rb, line 44 44: def test_version 45: assert_equal("1.1", Snarl.version) 46: end