Sha256: 38d0a65a812a77d2f604975ebe32e05fbded3350aba47118f34c697590f32e4f

Contents?: true

Size: 1.22 KB

Versions: 4

Compression:

Stored size: 1.22 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, @priority)
    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

4 entries across 4 versions & 2 rubygems

Version Path
carlosbrando-autotest-notification-1.8.1 test/test_autotest_notification.rb
carlosbrando-autotest-notification-1.8.2 test/test_autotest_notification.rb
carlosbrando-autotest-notification-1.9.0 test/test_autotest_notification.rb
samflores-autotest-notification-1.8.2 test/test_autotest_notification.rb