Sha256: b005292be63756630a7e93602cd0153a429979a91f4c1611e0d5ad58080f381b

Contents?: true

Size: 980 Bytes

Versions: 1

Compression:

Stored size: 980 Bytes

Contents

require File.dirname(__FILE__) + '/test_helper.rb'

class TestAutotestNotification < Test::Unit::TestCase
  
  def setup
    @title = "title"
    @msg   = "message"
    @image = "image"
    
    Object.const_set :DOOM_EDITION, false
  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, 0)
    verify_to("linux")
  end
  
  def test_notify_when_os_is_mac
    AutotestNotification::Mac.expects(:notify).with(@title, @msg, @image, 0, 0)
    verify_to("darwin")
  end
  
  private
  def verify_to(so)
    AutotestNotification.const_set("RUBY_PLATFORM", so)
    AutotestNotification.notify(@title, @msg, @image)
  end
  
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
notch8-autotest-notification-1.2.0 test/test_autotest_notification.rb