ãã¹ãã¯ã¨ãã¨ãèªåã§æ¥½ãã...ã
ããã¾ã§ããã¹ãã³ã¼ãã®å®é¨ã®ãããªæ°æã¡ã§unitãã¹ããfunctionalãã¹ãã¨è©¦ãã¦ãããããããã®ãã¹ããå®è¡ããçºã«ã¯ãrake test:unitsãã¾ãã¯rake test/functionalsã¨ã¿ã¼ããã«ããå
¥åãã¦å®è¡ãã¦ããããã°ããããã¨ããã®ã³ãã³ãã¯ãã¹ãã³ã¼ããæ¸ããããã½ã¼ã¹ã³ã¼ããç·¨éãããã常ã«ç¹°ãè¿ãå®è¡ããéå½ã«ãããã¨ã«æ°ä»ãããããã¦ããªãã¹ãçããµã¤ã¯ã«ã§å®æ½ãã¦ãããæ¹ããåé¡ãçºçããæã«ãã®åå ãç¹å®ãæããªãã¯ãã ãã¨ãããã¨ãã
ãã®ãããªçµç·¯ããããRailsã§ã¯ã·ã³ãã«ã«ãrakeãã¨å
¥åãã¦å®è¡ããã¨ãtestãã©ã«ã以ä¸ã®ãã¹ã¦ã®ãã¹ããå®è¡ããä»çµã¿ã«ãªã£ã¦ãããï¼ç¾ç¶ã§ãrakeããå®è¡ããã¨ãunitãã¹ããfunctionalãã¹ã両æ¹ã®çµæã表示ããããï¼
ã¨ããããããã«æ«ã使ãç¶ãã¦ããã¨ããã®ãrakeãã¨ããã³ãã³ãã®å®è¡ãããé¢åã ã¨æããããã«ãªããã人éã楽ããããã¨ãããããªãç¡ããã¨ããè¨ãããããRubyçã®åªç§ãªäººéã¯ç´ æ´ãããããZenTestãã¨ãããã¹ããã¼ã«ãä½ãä¸ãã¦ãã¾ã£ã...ã
ZenTestãå©ç¨ãã
ã¤ã³ã¹ãã¼ã«
- ã¤ã³ã¹ãã¼ã«ã¯ã¨ã¦ãç°¡åã
$ sudo gem install ZenTest
èªåãã¹ã
- ã¤ã³ã¹ãã¼ã«ãããã以ä¸ã®ã³ãã³ããå®è¡ããã ãã§OKã
$ autotest
- ãã以éãã³ã¼ããå¤æ´ããã¨ãã¹ããèªåçã«å®è¡ããããã¹ãçµæã表示ããããç´ æ´ãããï¼
autotestã®è¨å®ãã¡ã¤ã«
- ZenTestã«ã¯ãexample_dot_autotest.rbãã¨ããè¨å®ãã¡ã¤ã«ã®éå½¢ãç¨æããã¦ãã¦ããããã.autotestãã¨ãããã¡ã¤ã«åã§ãã¼ã ãã£ã¬ã¯ããªã«ã³ãã¼ãã¦ããã®æ¯ãèãã調æ´ã§ããã
$ cp /Library/Ruby/Gems/1.8/gems/ZenTest-3.9.1/example_dot_autotest.rb ~/.autotest
- ã³ã¡ã³ããã¼ã¯ã#ããåé¤ãã¦ãrequire 'autotest/redgreen'ããæå¹ã«ãã¦ã¿ãã¨...
#a -*- ruby -*- # require 'autotest/autoupdate' # require 'autotest/camping' # require 'autotest/cctray' # require 'autotest/emacs' # require 'autotest/fixtures' # require 'autotest/growl' # require 'autotest/heckle' # require 'autotest/html_report' # require 'autotest/kdenotify' # require 'autotest/menu' # require 'autotest/migrate' # require 'autotest/notify' # require 'autotest/pretty' require 'autotest/redgreen' # require 'autotest/screen' # require 'autotest/shame' # require 'autotest/snarl' # require 'autotest/timestamp' # Autotest::AutoUpdate.sleep_time = 60 # Autotest::AutoUpdate.update_cmd = 'svn up' # Autotest::Emacs.client_cmd = 'emacsclient -e' # Autotest::Heckle.flags ãã --ãã¹ãã失æã«çµããã¨èµ¤ã®ã ãã >| $ <span style="font-weight:bold;">autotest</span> loading autotest/rails hook run has been deprecated, use initialize /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby -I.:lib:test -rtest/unit -e "%w[test/functional/slips_controller_test.rb test/unit/journal_test.rb test/unit/slip_test.rb].each { |f| require f }" | unit_diff -u Loaded suite -e Started ....../Users/bebe/railsapp/test_slip202/app/helpers/application_helper.rb:16: warning: default `to_a' will be obsolete ."[#<Slip id: 1, number: 1, total_yen: 1000, executed_on: \"2/14\", created_at: \"2008-03-04 16:11:14\", updated_at: \"2008-03-04 16:11:14\">, #<Slip id: 2, number: 2, total_yen: 2000, executed_on: \"2/15\", created_at: \"2008-03-04 16:11:14\", updated_at: \"2008-03-04 16:11:14\">]" "[#<Journal id: 1, comment: \"test1\", yen: 1000, slip_id: 1, position: 1, created_at: \"2008-03-04 16:11:14\", updated_at: \"2008-03-04 16:11:14\">]" /Users/bebe/railsapp/test_slip202/app/helpers/application_helper.rb:16: warning: default `to_a' will be obsolete .... Finished in 0.427456 seconds. 11 tests, 22 assertions, 0 failures, 0 errors <span style="color:#33FF00;">================================================================================</span> |< ãã¹ãçµæã®ç¢ºèªããã¨ã¦ãè¦æããªã£ãï¼ **çµæãGrowlã§ç¢ºèªãã ã³ã¼ãã®ä¿®æ£ãç£è¦ããããã¹ããèªåå®è¡ãããç°å¢ã¯ãªãã¦ç´ æ´ããããã ï¼ã¨æåãã¦æ¥½ãã¿ãªããã³ã¼ããä¿®æ£ãã¦ããã¨...ããã«å¥ã®æ©ã¿ãçºçããã¹ãã¯èªåã§å®è¡ããããããã®ãã¹ãçµæã確èªããçºã«ãã³ã¼ãç·¨éä¸ã®ã¨ãã£ã¿ã¨ã¿ã¼ããã«ã®éã§ãé »ç¹ã«ã¢ããªã±ã¼ã·ã§ã³ã®åãæ¿ããããå¿ è¦æ§ã«æ°ä»ããããã§ã¯ãã£ããã®autotestã®é åãåæ¸ãã¦ãã¾ã...ã((åºå¤§ãªã¹ã¯ãªã¼ã³ç°å¢ãªããã¦ã£ã³ãã¦ã®é ç½®ã工夫ããã°ãã³ã¼ããç·¨éããªããã¿ã¼ããã«ã§ãã¹ãçµæã確èªã§ããããã«ãããã¨ãå¯è½ãããããªããããããMacBookã®ã¹ã¯ã¼ãªã¼ã³ãµã¤ãºã§ã¯...ã)) ããããMacã«ã¯[http://growl.info/about.php:title=Growl]ããããããããã¹ãçµæãGrowlã§éç¥ã§ããã°ãã¢ããªã±ã¼ã·ã§ã³ã®åãæ¿ãã¯ä¸è¦ã«ãªããããã¦ãautotestã¯Growlã«ã対å¿ãã¦ããï¼ ***Growlã®ã¤ã³ã¹ãã¼ã« -ã¾ãã¯[http://growl.info/downloads.php:title=Growl Downloads]ã®ãã¼ã¸ãããGrowl 1.1.2 ããã¦ã³ãã¼ãããã -.dmgãã¡ã¤ã«ãéãã¦Growlã®ã¤ã³ã¹ãã¼ã«ã -ããã«Extrasãã©ã«ãä¸ã®growlnotifyãã¤ã³ã¹ãã¼ã«ãã¦ããã >| $ <span style="font-weight:bold;">cd /Volumes/Growl\ 1.1.2/Extras/growlnotify </span> $ <span style="font-weight:bold;">./install.sh</span> |< -ã¤ã³ã¹ãã¼ã«å¾ãMacBookãåèµ·åãã¦ãããã ***Growlã«å¯¾å¿ããautotestã®è¨å® -è¨å®ãã¡ã¤ã«ã~/.autotestããéãã¦ãã³ã¡ã³ããã¼ã¯ã#ããåé¤ãã¦ãrequire 'autotest/growl'ããæå¹ã«ããã >|ruby| #a -*- ruby -*- # require 'autotest/autoupdate' # require 'autotest/camping' # require 'autotest/cctray' # require 'autotest/emacs' # require 'autotest/fixtures' require 'autotest/growl' # require 'autotest/heckle' # require 'autotest/html_report' # require 'autotest/kdenotify' # require 'autotest/menu' # require 'autotest/migrate' # require 'autotest/notify' # require 'autotest/pretty' require 'autotest/redgreen' # require 'autotest/screen' # require 'autotest/shame' # require 'autotest/snarl' # require 'autotest/timestamp' # Autotest::AutoUpdate.sleep_time = 60 # Autotest::AutoUpdate.update_cmd = 'svn up' # Autotest::Emacs.client_cmd = 'emacsclient -e' # Autotest::Heckle.flags << '-t test/**/*.rb' # Autotest::Heckle.klasses << 'MyClass' # Autotest::Shame.chat_app = :adium
Mac OSX 10.5 Leopardã§growlnotifyãå©ç¨ããçºã«
ããOSX 10.4 Tigerãªãããã®ç¶æ ã§autotestãå®è¡ããã°ãè¦äºã«çµæãGrowlã§éç¥ãããæåã§ããã¨æããããããOSX 10.5 Leopardã§ã¯growlnotifyãå®å ¨ã«ã¯å¯¾å¿ãã¦ããªãããã ...ããã®ãããåèãã¼ã¸ã§ç´¹ä»ããã¦ããéãã以ä¸ã®ããã«ãã£ã¦ã¿ãã
- ãã¡ã¤ã«åãgrowlnotifyãããgrowlnotify.wrappedãã«å¤æ´ããã
$ mv /usr/local/bin/growlnotify /usr/local/bin/growlnotify.wrapped
- ä¸è¨ã®å¤æ´å¾ãæ°ãã«å®è¡æ¨©éãæã£ããgrowlnotifyããä½æã...
$ touch /usr/local/bin/growlnotify $ chmod a+x /usr/local/bin/growlnotify
- ãã®å
容ã以ä¸ã®ã·ã§ã«ã¹ã¯ãªããã§ä¿åãã¦ããã
-
- åè§ï¿¥ï¼åãã¼ã¯ï¼ã¯ãåè§ï¼¼ï¼ããã¯ã¹ã©ãã·ã¥ï¼ã«ç½®ãæããå¿ è¦ããã
-
#!/bin/bash # growlnotify leopard bug workaround # list_args() { for p in "$@" do if [ "${p:0:1}" == "-" ];then echo -n "$p " else echo -n "\"$p\" " fi done } argstr=$(list_args "${@:$?}") echo "-H localhost $argstr" | xargs /usr/local/bin/growlnotify.wrapped
- ãã¯ããä¸è¨ã®ã©ããã³ã°æã¯ä¸è¦ã ãããã£ã¨åç´ã«ä»¥ä¸ã®ã¨ã¤ãªã¢ã¹è¨å®ã§ãè¯ãããã
$ alias growlnotify='/usr/local/bin/growlnotify.wrapped -H localhost'
- åèãã¼ã¸
- cocoaforge - A Festivus for the Rest of Us » View topic - growlnotify not working on Leopard
- Growlnotify Leopard incompatibility workaround : hasseg.org
ç´ æ´ããããã¼ã¸ã«æè¬ã§ãï¼
- ä½ããã£ã¦ããã®ãï¼
- Growlã«ã¯ãããã¯ã¼ã¯çµç±ã§éç¥ãããã¡ãã»ã¼ã¸ã表示ããã¨ããæ©è½ããããOSX 10.5ç°å¢ã®growlnotifyã¯ãããã¯ã¼ã¯çµç±ã®éç¥ã ãã¯åãåã£ã¦ãæ£å¸¸ã«å¦çã§ããããã ã
- å ã ã®ã³ãã³ãgrowlnotify. wrappedãå®è¡ããåã«ãã·ã§ã«ã³ãã³ãã§ãã¹ã¦ã®å¼ã³åºãããããã¯ã¼ã¯çµç±ã®growlnotifyã«å¤æãã¦ããå®è¡ãã¦ããããã ã
Growlã®ç°å¢è¨å®
- ãããã¯ã¼ã¯çµç±ã®éç¥ã«ãªããããGrowlç°å¢è¨å®ã¯ä»¥ä¸ã®ããã«ãã¦ããã
- ä¸æ¦ãautotestãGrowlã«ç»é²ãããããããªã¢ã¼ãã¢ããªã±ã¼ã·ã§ã³ç»é²ã許å¯ãã®ãã§ãã¯ã¯å¤ãã¦ãã¾ã£ã¦åé¡ãªãã
- ããã¦ã¬ãã«ããç·æ¥ãã®éç¥ã«ã¤ãã¦ã¯èµ¤ã表示ãããè¨å®ã«ãã¦ãããã
- ããã§autotestãå®è¡ããã¨ãGrowlã§ä»¥ä¸ã®ããã«éç¥ãããããã«ãªã£ãã
ä½ã ããã¹ãã楽ãããªã£ã¦ããï¼
- åèãã¼ã¸
ç´ æ´ããããã¼ã¸ã«æè¬ã§ãï¼