Sha256: 8f918acbb3404535f5c8c14b081c7d9ed7acb402124aa25f0a066f63d3898e5a
Contents?: true
Size: 1.25 KB
Versions: 3
Compression:
Stored size: 1.25 KB
Contents
require File.dirname(__FILE__) + '/test_helper.rb' class TestAutotestNotification < Test::Unit::TestCase def setup @title = "title" @msg = "message" @image = "image" @priority = 0 @total = 0 @failures = 0 %w( DOOM_EDITION SPEAKING STICKY BUUF ).each do |c| AutotestNotification.const_set(c.to_sym, false) unless AutotestNotification.const_defined?(c.to_sym) end end def test_notify_when_os_is_cygwin AutotestNotification::Cygwin.expects(:notify).with(@title, @msg, @image) verify_to("cygwin") end def test_notify_when_os_is_windows AutotestNotification::Windows.expects(:notify).with(@title, @msg, @image) verify_to("mswin") end def test_notify_when_os_is_linux AutotestNotification::Linux.expects(:notify).with(@title, @msg, @image, @total, @failures) verify_to("linux") end def test_notify_when_os_is_mac AutotestNotification::Mac.expects(:notify).with(@title, @msg, @image, @total, @failures, @priority) verify_to("darwin") end private def verify_to(so) AutotestNotification.const_set :RUBY_PLATFORM, so AutotestNotification.notify(@title, @msg, @image, @total, @failures, @priority) end end
Version data entries
3 entries across 3 versions & 1 rubygems