追è¨2ï¼2015/09/08ï¼ããããããã¨ã«ãæªã ã«ãã®è¨äºãããã¯ãã¼ã¯ãã¦ãã ããæ¹ãããã£ãããã¾ããã2008å¹´ã«æ¸ããè¨äºãªã®ã§ã注æä¸ãããå 容ã¯ã¢ãããã¼ããã¦ãã¾ãããç§èªèº«ã¯ãã§ã«Rubyã使ã£ã¦ãã¾ããã 追è¨ï¼å¤ãæ å ±ã§ãã®ã§ãè¨äºã®æ¥ä»ã¨ã使ãã®RSpecã®ãã¼ã¸ã§ã³ãè¦æ¯ã¹ã¦ãåèç¨åº¦ã«ã覧ãã ããã大é¨åã¯éç¨ããã¯ãã§ããã Matcherããã¡ãã¡èª¿ã¹ãã®ãé¢åã«ãªã£ã¦ãå ¬å¼ã®ãªãã¡ã¬ã³ã¹ããã¥ã¢ã«ã¯ä¸è¦§æ§ãä½ããããèªåã§ä¸è¦§è¡¨ãä½ã£ãã RSpecãã®ãã®ã«ã¤ãã¦ã¯ãã¹ã¯ã¹ããã¯ã®ã¹ ã第 1 åã RSpec ã®æ¦è¦ã¨ãRSpec on Rails (ã¢ãã«ç·¨)ãªã©ãã©ããããã®ãã¡RSpec on Railsçãä½ãäºå®ã åå not((should_notã§ä½¿ãããã©ããã¨ããæå³ã)) æå³ã»æ©è½ == â ==æ¼ç®åãå©ç¨ãã¦æ¯è¼ãããex
Controller Examples live in $RAILS_ROOT/spec/controllers/. In contrast to Test::Unit, where the controller is initialized in the setup method, with Spec::Raiks you donât. Instead, pass the controller class to the describe method. Spec::Rails automatically instantiates a controller for you, which you can access from the examples (it blocks) using the controller method. Isolation from views Spec::Ra
ã©ããªã«é å¼µã£ã¦æ¤ç´¢ãã¦ãããããããæ¥æ¬èªã®ããã¥ã¡ã³ãããªãã£ãã®ã§ãè¨é²ã Rubyist Magazine - ã¹ã¯ã¹ããã¯ã®ã¹ ã第 2 åã RSpec on Rails (ã³ã³ããã¼ã©ã¨ãã¥ã¼ç·¨) ãåèã«ãã§ãããã«ãã¼ã®ãã¹ãã®ãã¨ã¯æ¬¡å以éã§èª¬æãã¾ãããã¨ç¥ãããã£ããã¨ããã£ã½ãæãã¦ããã®ã§ãç¶ç·¨ãççã«å¸æã ã¾ãã¯generatorã§ã²ãªå½¢ãä½ã(ä¸ã®ãã¼ã¸åç §) ruby script/generate rspec_controller blogs ã¡ãªã¿ã«ããã«ãã¼ã¡ã½ããã®ãã¹ãç¨ã®generatorç¡ããããã ãã®æ注æãªãã ãã©ããã®rspecã®generatorã¯./app/controller/ã¨ã./app/helper/ã¨ãã®ãã¡ã¤ã«ãä¸æ¸ããããã¡ããã¨YorNã¨èãã¦ãããã ãã©ãã¾ããappãã£ã¬ã¯ããªä»¥ä¸ãä¸æ¸ããããã¨ã¯ãªãã ãã
Shouldaï¼ãã£ã¨æ©ã使ã£ã¦ããã°ï¼by é人ããã°ã©ããRubyã®ãã¹ãã«ã¯ãRSpecããããã©ãShouldaãè¯ããã Rubyã®ãã¹ãã«ã¯ãRSpecããããã©ãShouldaãè¯ãããã£ã¦ãã¨ã§ã é人ããã°ã©ãã®David ThomasãShouldaãåãããããç´¹ä»ãã¦ããã¦ããã®ã§ã仮訳ãã¦ã¿ããã ï¼ç¿»è¨³ã»å ¬éãããã¨ãå¿«ãæ¿è«¾ãã¦ããã¾ãããï¼ è±èªãè¦æãªã®ã§ééããããã¨æãã¾ããææãã¦ãããã¨å¬ããã§ãã ãªãªã¸ãã«ã®è¨äºï¼Shoulda used this earlier ââ ãããã ââ Shouldaï¼ãã£ã¨æ©ã使ã£ã¦ããã°ï¼ è²ããªæå³ã§ãã½ããã¦ã§ã¢ããã¹ããããã¨ã¯ãå¤ã«åºã¦éåããããã¨ã«ä¼¼ã¦ãããããªãããããªããã¨ã¯åãã£ã¦ãããéåã¯èªåãè¯ãç¶æ ã«ãã¦ãããã®ã¯åãã£ã¦ããã ãã©ãããããããªãè¨ã訳ãèããã®ããããç°¡åã ï¼
ä»ä»äºã§Railsã¢ããªã±ã¼ã·ã§ã³ãçµãã¨ãã«ãtest/unitãããªãã¦RSpecã使ã£ã¦ããmockå¨ãã®ä½¿ãåæãããã¨ããèªå½ã馴æã¿ãããã¨ãããããé åããããã ãã©ããã®ãå¯èªæ§ããä¿ã¤ã«ã¯ãªããªãã³ããããã¨æããè¨ãã¾ã§ããªãRSpecã¯Rubyã®ã³ã¼ãããè±èªã®è¡¨ç¾ã¨ãã¦èªç¶ã«è¦ãããããã«ãããã¨ãæå³ãã¦èªå½ãæ¸ãæ¹ã決ãã¦ãããããã¯è±èªåã®ã¨ã³ã¸ãã¢ã«ã¯é常ã«ç´ æµãªãã¨ã§ã¯ãããã ãã©ãè±èªãè¦æã§è±ä½æãªãã¦å§ãã¦æ°åã§æ³£ããããªããããªã¸ããå¤å½èªå¦é¨çã«ã¨ã£ã¦ã¯æ£ç´ãã£ããã ããå¨ãã®äººéã®å¤§åã¯è±èªã«æ £ãã¦ããªã人é*1ã ã£ããããã®ã§ããã£ããå¯èªæ§ãé«ã綺éºãªè¡¨è¨ã§ãããããæå³ãç解ãã妨ãã«ãªã£ããããããã£ããã¤ãèªã§æ¸ãã¦ããåå¼·ãã«æ´»ç¨ãã¦ããããã¨ããè¡åã«é§ããããã©ãã誰ä¸äººã¨ãã¦èªããªãä¸ã«ä¸é±éå¾ã®ä¿ºã§ããç解ã«è¦ãã¿ãããªã®ã§
æè¿Macã®åã¤ã³ã¹ãã¼ã«ãã¦ããéçºç°å¢ãä¸éå端ã ã£ãã®ã§ãRailsã®ãã¹ãç°å¢ãæ¹ãã¦æ´åãã®ã¡ã¢ 1) Railséçºç°å¢ã¯å ¥ã£ã¦ãã 2) RSpecå ¥ããã % sudo gem install rspec 3) ZenTestå ¥ãã ã% sudo gem install ZenTest 3) diff-lcså ¥ããã% sudo gem install diff-lcs 4) èªåã®Railsã¢ããªã®ãã£ã¬ã¯ããªã¸ç§»åã % cd /RAILS_ROOT/ 5) rspec on railså ¥ããã % sudo ruby script/plugin install svn://rubyforge.org/var/svn/rspec/tags/REL_1_0_5/rspec_on_rails 6) RSpecé¢ä¿ãã¡ã¤ã«ã®ã»ããã¢ããã % ruby script/gen
å¿ è¦ãªæé ã¯åç §å ã¨ã»ã¨ãã©åãã§ãããå¤æ´ç¹ã¯11çªããã Macã®Growlã«ç¸å½ãããã®ã¯ãUbuntuã§ã¯Notifyãããããã¡ããå©ç¨ã sudo apt-get install libnotify-bin ~/.autotestãã¡ã¤ã«ã以ä¸ã®ãããªå 容ã«ããã module Autotest::Notify def self.notify(title, message, priority='critical') icon = if priority == 'critical' 'dialog-error' else 'dialog-information' end system "notify-send -u #{priority} -t 10000 -i #{icon} '#{title}' '#{message.inspect}'" end Autotest.add_h
ããã³ã¾ãã¯ãRuby ã«é¢ããæè¡è¨äºã¯ãã¡ããã®ãã¨ãRubyist ã¸ã®ã¤ã³ã¿ãã¥ã¼ãã¨ãã»ã¤ããã®ä»ããå±ãããã¦ã§ãéèªã§ãã Rubyist Magazine ã«ã¤ã㦠ãRubyist Magazineããç¥ãã¦ããã³ã¾ãã¯ãæ¥æ¬ Ruby ã®ä¼ã®æå¿ã«ãã Rubyist ã® Rubyist ã«ãããRubyist ã¨ããã§ãªã人ã®ããã®ã¦ã§ãéèªã§ãã ææ°å· Rubyist Magazine 0058 å· ããã¯ãã³ãã¼ Rubyist Magazine 0058 å· RubyKaigi 2018 ç´åç¹éå· Rubyist Magazine 0057 å· RubyKaigi 2017 ç´åç¹éå· Rubyist Magazine 0056 å· Rubyist Magazine 0055 å· Rubyist Magazine 0054 å· æ±äº¬ Ruby ä¼è° 11 ç´
2008-01-12 18:39 : RSpec ãã¤ã³ã¹ãã¼ã«ãã¦ã¿ã Kodougu ã®ãã¹ãã RSpec ã§æ¸ãã¦ã¿ããã¨æã£ãã®ã§ãRSpec ãã¤ã³ã¹ãã¼ã«ãã¦ã¿ã¾ããã ã©ãããããããRubyist Magazine - ã¹ã¯ã¹ããã¯ã®ã¹ ã第 1 åã RSpec ã®æ¦è¦ã¨ãRSpec on Rails (ã¢ãã«ç·¨)ã®ããæ¹ã§ã¯, RSpec on Rails ãã¤ã³ã¹ãã¼ã«ã§ããªãã£ãã®ã§ã以ä¸ãåèã«ã¤ã³ã¹ãã¼ã«ãã¦ã¿ã¾ããã RSpec-1.1.1: Installation http://rspec.info/documentation/rails/install.html ruby script/plugin install http://rspec.rubyforge.org/svn/tags/CURRENT/rspec ruby
ããã³ã¾ãã¯ãRuby ã«é¢ããæè¡è¨äºã¯ãã¡ããã®ãã¨ãRubyist ã¸ã®ã¤ã³ã¿ãã¥ã¼ãã¨ãã»ã¤ããã®ä»ããå±ãããã¦ã§ãéèªã§ãã Rubyist Magazine ã«ã¤ã㦠ãRubyist Magazineããç¥ãã¦ããã³ã¾ãã¯ãæ¥æ¬ Ruby ã®ä¼ã®æå¿ã«ãã Rubyist ã® Rubyist ã«ãããRubyist ã¨ããã§ãªã人ã®ããã®ã¦ã§ãéèªã§ãã ææ°å· Rubyist Magazine 0058 å· ããã¯ãã³ãã¼ Rubyist Magazine 0058 å· RubyKaigi 2018 ç´åç¹éå· Rubyist Magazine 0057 å· RubyKaigi 2017 ç´åç¹éå· Rubyist Magazine 0056 å· Rubyist Magazine 0055 å· Rubyist Magazine 0054 å· æ±äº¬ Ruby ä¼è° 11 ç´
ã©ã³ãã³ã°
ã©ã³ãã³ã°
ã©ã³ãã³ã°
ãªãªã¼ã¹ãé害æ å ±ãªã©ã®ãµã¼ãã¹ã®ãç¥ãã
ææ°ã®äººæ°ã¨ã³ããªã¼ã®é ä¿¡
å¦çãå®è¡ä¸ã§ã
j次ã®ããã¯ãã¼ã¯
kåã®ããã¯ãã¼ã¯
lãã¨ã§èªã
eã³ã¡ã³ãä¸è¦§ãéã
oãã¼ã¸ãéã
{{#tags}}- {{label}}
{{/tags}}