Sha256: 6818a0c6d2ff33dc91a5610be21168518a290318292a0b12d29bd383a51fc00e
Contents?: true
Size: 1.61 KB
Versions: 10
Compression:
Stored size: 1.61 KB
Contents
require 'test/test_helper' class TestWatchr < Test::Unit::TestCase def setup Watchr.options = nil end ## options test "debug option" do Watchr.options.debug.should be(false) Watchr.options.debug = true Watchr.options.debug.should be(true) end ## functionality test "debug" do capture_io { Watchr.debug('abc') }.stdout.should be('') Watchr.options.debug = true capture_io { Watchr.debug('abc') }.stdout.should be("[watchr debug] abc\n") end test "picking handler" do Watchr.handler = nil ENV['HANDLER'] = 'linux' Watchr.handler.should be(Watchr::HAVE_REV ? Watchr::EventHandler::Unix : Watchr::EventHandler::Portable) Watchr.handler = nil ENV['HANDLER'] = 'bsd' Watchr.handler.should be(Watchr::HAVE_REV ? Watchr::EventHandler::Unix : Watchr::EventHandler::Portable) Watchr.handler = nil ENV['HANDLER'] = 'darwin' Watchr.handler.should be(Watchr::HAVE_REV ? Watchr::EventHandler::Unix : Watchr::EventHandler::Portable) Watchr.handler = nil ENV['HANDLER'] = 'unix' Watchr.handler.should be(Watchr::HAVE_REV ? Watchr::EventHandler::Unix : Watchr::EventHandler::Portable) Watchr.handler = nil ENV['HANDLER'] = 'mswin' Watchr.handler.should be(Watchr::EventHandler::Portable) Watchr.handler = nil ENV['HANDLER'] = 'cygwin' Watchr.handler.should be(Watchr::EventHandler::Portable) Watchr.handler = nil ENV['HANDLER'] = 'portable' Watchr.handler.should be(Watchr::EventHandler::Portable) Watchr.handler = nil ENV['HANDLER'] = 'other' Watchr.handler.should be(Watchr::EventHandler::Portable) end end
Version data entries
10 entries across 10 versions & 2 rubygems