ä¸å®å®ãã¹ããçã¿åºãCapybaraã調æãã 2020/06/12 @é座Rails #22 Masatoshi Iwasaki
ä¸å®å®ãã¹ããçã¿åºãCapybaraã調æãã 2020/06/12 @é座Rails #22 Masatoshi Iwasaki
Speee ã¨ã³ã¸ãã¢çµç¹æ¨é²å®¤ã®æé¨ (yhatt) ã§ãã ã¿ãªãã E2E ãã¹ãããã¦ãã¾ãã§ãããããå¼ç¤¾ã® Ruby on Rails ãããã¯ãã«ããã¦ã¯ãRSpecãCapybaraã Poltergeist ãçµã¿åããã feature spec 㧠E2E ãã¹ããè¡ãæ§æãä¸è¬çã§ããã ãããªä¸ãChrome 59 ã« ãããã¬ã¹ã¢ã¼ã (--headless) ãæè¼ ããããã¨ã§ããã¹ãã CI ç°å¢ã«ããã¦ãææ°ã® Chrome ç°å¢ã«ãã E2E ãã¹ããå®æ½ã§ããããã«ãªãã¾ãããããã«åããã¦ãPhantomJS ã®ã³ã¢ã¡ã³ããã¼ãã¡ã³ããã¼ãéãã ãã¨ãçºè¡¨ããPhantomJS ã®ã¢ãããã¼ãããç¶ç¶çãµãã¼ãã¯æå¾ ã§ããªãç¶æ³ã¨ãªã£ã¦ãã¾ãã ãããã¬ã¹ Chrome ãã¨ã¯ãã  | Web  | Google Developers [A
ãå¾ ãããã¾ããï¼ ã¤ãã«ãEveryday Rails - RSpecã«ããRailsãã¹ãå ¥éãï¼ä»¥ä¸Everyday Railsï¼ã®æ¹è¨çããªãªã¼ã¹ãã¾ããã ãã§ã«æ¥æ¬èªçEveryday Railsãè³¼å ¥ããã¦ããæ¹ã¯ãLeanpubã®ãµã¤ãã«ãã°ã¤ã³ãã¦ææ°çã®é»åæ¸ç±ãã¡ã¤ã«ãç¡æã§ãã¦ã³ãã¼ããããã¨ãã§ãã¾ãã ãã®ã¨ã³ããªã§ã¯ä»åã¢ãããã¼ããããEveryday Railsã®å 容ãç´¹ä»ãã¾ãã ã¾ããä¾¡æ ¼æ¹å®ã®äºåãå«ã¾ãã¦ããã®ã§ãã¾ã è³¼å ¥ããã¦ããªãæ¹ã¯ãã¡ãããä¸èªãã ããã æ¹è¨çã®3大å¤æ´ç¹ å¤æ´ç¹ãã®1ï¼Rails 5.1 + RSpec 3.6ã«å¯¾å¿ 2018.3.12追è¨ï¼ããã°è¨äºã翻訳ãã¾ããï¼ å¤æ´ç¹ãã®2ï¼ãµã³ãã«ã¢ããªã±ã¼ã·ã§ã³ã®å¤æ´ åèï¼ãµã³ãã«ã¢ããªã±ã¼ã·ã§ã³ã®ã½ã¼ã¹ã³ã¼ã å¤æ´ç¹ãã®3ï¼æ¬æã®å¤§è¦æ¨¡ãªãªã©ã¤ã ã¢ãããã¼ãæé ããã«
Deleted articles cannot be recovered. Draft of this article would be also deleted. Are you sure you want to delete this article? ã¯ããã« RSpecã¯é£ãããããããããªããã¨ãã£ãã³ã¡ã³ããã¨ãã©ãè¦ããã¾ãã 確ãã«ã¡ãã£ã¨ç¬ç¹ãªæ§æãæã£ã¦ãã¾ãããæ©è½ãçµæ§å¤ãã®ã§ãé£ããããã¨æãã¦ãã¾ãæ°æã¡ããããã¾ãã ï¼æ§æã«ã¤ãã¦ã¯åãæåè¦ãã¨ãã«ãããã£ããªããæ°æã¡ããã£ãã¨æã£ãè¨æ¶ãããã¾ãwï¼ ããããRSpecã«éããã©ããªãã¬ã¼ã ã¯ã¼ã¯ã§ãåãã§ãããæ £ãã¦ãã¾ãã°ã¹ã©ã¹ã©æ¸ãã¾ãããå®éåèªèº«ã¯ãRSpecã£ã¦ä¾¿å©ã ãªï¼ãã¨æããªãããã¹ãã³ã¼ããæ¸ãã¦ãã¾ãã ããã§ãã®è¨äºã§ã¯ãåãèãããæä½éããã ããæ¼ããã¦ããã°å¤§ä¸å¤«ï¼ï¼ããªR
Puppet ã Chef ã§æ§ç¯ãããµã¼ãã RSpec ã§ãã¹ããã ã§æ¸ããä»çµã¿ã使ããããããããã« serverspec ã¨ããåå㧠gem åãã¦ã¿ãã rubygems.org ã«ãç»é²ãã¦ããã®ã§ãgem install ã§ã¤ã³ã¹ãã¼ã«ã§ããã $ gem install serverspec ã¤ã³ã¹ãã¼ã«ããããé©å½ãªãã£ã¬ã¯ããªã§ serverspec-init ãå®è¡ãããã¨ãéå½¢ã¨ãªããã£ã¬ã¯ããªããã¡ã¤ã«ãçæããã $ serverspec-init + spec/ + spec/www.example.jp/ + spec/www.example.jp/httpd_spec.rb + spec/spec_helper.rb + Rakefile spec/www.example.jp/httpd_spec.rb ããµã³ãã«ãã¹ãã³ã¼ãã§ããããªæãã«ãªã£ã¦
ç§ãRSpec使ã£ã¦ãã¹ãæ¸ãæã¯ãããªæãã§æ¸ãã¦ãããã£ã¦ã®ãæ¸ãã¦ã¿ãã*1 ãã¹ããæ¸ãé çªã«ã¤ã㦠TDDã§ã³ã¼ããæ¸ãå ´åãå ã«ãã¹ããæ¸ãäºã«ãªãã¾ãã ããã¦ããã®ãã¹ããæ¸ãé çªã§ãããç§ã¯ä¸è¨ã®ãããªé çªã§æ¸ãããã«æèãã¦ãã¾ãã è¨è¨ãã describe ãæ¸ã itãæ¸ã subjectãæ確ã«ãã before(context)ãæ確ã«ãã ãã®ä»ã«ãæ°ãã¤ãã¦ããç¹ã¯ãããªæã å¥ã®ã¡ã½ããå¼ã¶æã¯åºæ¬çã«stubãªã©ã§æ½°ã contextã¯ããã®å ´åããit ã¯ããã§ãããã¨ãã«ãªãããã«ãã ä¸ã¤ãã¤ã詳細ãæ¸ãã¾ãã è¨è¨ãã ãã¹ããæ¸ãå§ããåã«ãã¾ãå®è£ ãããã¨ãã¦ãã¯ã©ã¹ãã¡ã½ãããç°¡åã«è¨è¨ãã¾ãã å°ãªãã¨ãããã¯ã©ã¹åããã¯ã©ã¹ã¡ã½ãã or ã¤ã³ã¹ã¿ã³ã¹ã¡ã½ããããã¡ã½ããåããã¡ã½ããã®æ»ãå¤ããããã¯æ±ºãã¾ãã describe ã
2012å¹´04æ19æ¥ æè¿ãæ°äººã®ãã¹ãã³ã¼ããè¦ãæ©ä¼ããããã¦ããããã¹ãã®æ¸ãæ¹ã«ã¤ãã¦èããæ©ä¼ããã£ããã¦ããããã¹ãã¯ãã³ãã¬ã¼ãã¿ãããªãã®ãããã®ã§ãããããæ¼ãããã°ã誰ã§ãç°¡åã«æ¸ããã¨ãã§ããã ããã§ã¯ããã®æ¹æ³ã«ã¤ãã¦ç´¹ä»ãããããµã³ãã«ã¯RSpecã§æ¸ããããã®ä»ã®ã¦ããããã¹ããã¬ã¼ã ã¯ã¼ã¯ã§ããå¿ç¨ãã§ããã¨ãããã ã¯ããã«ããåç´åããã¨ããã¹ã対象ã¯ç¶æ ãæã¡ãå ¥åãä¸ããã¨ä½ããã®åºåãè¡ãªããã®ã§ãããå ¥åãå¤ããã°åºåã¯å¤åããããç¶æ ãå¤åããã¨å ¥åãåãã§ãåºåãå¤ããï¼ãããããªãï¼ã ã¦ããããã¹ãã¯ããã¹ã対象ã®ç¶æ ãæä½ããä¸ããå ¥åã«ãã£ã¦æå³éãã®åºåãå¾ããããã確èªããä½æ¥ã®ãã¨ãããããªã®ã§ãã¦ããããã¹ããæ¸ãã¨ãã«ã¯ããªãã¸ã§ã¯ãã®ç¶æ ãã¨ã«ã¡ã½ããåä½ã§å ¥åã¨åºåã確èªããããã«ããã RSpecã®çä¼¼ã³ã¼ãã§æ¸ãã¨
Railsã¨ã³ã¸ãã¢ã«ãªã£ã¦ãã1å¹´åããããçµã¡ã社å ã®Railsã®ããã¸ã§ã¯ããå ¨é¨ã§5ã¤ããã触ã£ã¦ãä»ãã£ã¦ãAbilie*1ã§ãããã人並ã¿ã«ãã¹ããæ¸ãã¦ãæ°ããã¦ããã®ã§ãç¾æç¹ã§ãã£ã¦ããã¹ãã®æ¹æ³ãã¾ã¨ãã¦ããã ãã¹ãã®ã«ã¼ã«çãªã® rspecã§ã¯å¿ ãã¢ãã«ã®ãã¹ãã¯æ¸ãããã«ãã¦ãããã«ãã¼ã大ä½æ¸ãã¦ããã©ãã³ã³ããã¼ã©ãã«ã¼ãã£ã³ã°ã®ãã¹ãã¯ãã¾ãæ¸ãã¦ãªãã ã¨ããã®ããã³ã³ããã¼ã©ã¼ã®ã³ã¼ãã極åçããã¦ã¢ãã«ã太ããã¦ããã®ã§ã³ã³ããã¼ã©ã®ãã¹ãã¯ããã¾ãæå³ãç¡ãæ°ããã¦ãã¦ããã®ä»£ããã«Capybaraã§ãã¹ããæ¸ãã¦ããã°ååãªããããªãããªã¨æã£ã¦ãããããCapybaraã¯æ¸ãã¦ãã®ã§ãããããæå³ã§ã¯æ¸ãã¦ãã¨ãè¨ããã 社å ã®ç®¡çè ã ãã使ãã管çç»é¢ãä½ã£ã¦ããã©ããã£ã¡ã¯ãã¹ãããã¾ãæ¸ãã¦ãªããããã¯åããªããªã£ã¦ãä¸è¬ã¦ã¼ã¶ã¼ã«ã¯å½±é¿ã
ãã¡ãã®è¨äºãåèã«èªåã§èªåãã¹ãç°å¢ãæ§ç¯ããè¨é²ã§ãããã®è¨äºã¯ãããåèã«ãªãã¾ãããæè¬ã§ãã Rails3+RSpec2+Spork+Guard(guard-rspec,guard-cucumber)ã§æéã®BDD(æ¯èé§åéçº)ç°å¢ãä½ã - Curiocity Drives me ï¼ï¼ç°å¢ # Gemfile source 'http://rubygems.org' gem 'rails' gem 'rake', '0.8.7' gem 'mysql2', '0.2.6' gem 'haml-rails' gem 'jquery-rails' $ bundle install --path vendor/bundleï¼ï¼rpec-rails, factory_girl_railsã®ã¤ã³ã¹ãã¼ã« # Gemfile source 'http://rubygems.org' g
Download: source codeProject Files in Zip (92.2 KB)mp4Full Size H.264 Video (26.4 MB)m4vSmaller H.264 Video (16.1 MB)webmFull Size VP8 Video (18.1 MB)ogvFull Size Theora Video (37.8 MB) ä»å¾ã®ã¨ãã½ã¼ãã§ã¯ããã¹ãã®è©±é¡ãããå¤ãåãä¸ãã¦ããããã¨æãã¾ããä»åã¯ãååã®ã¨ãã½ã¼ã[åç»ãè¦ã, èªã]ã§ãã°ã¤ã³ãã©ã¼ã ã«è¿½å ããããã¹ã¯ã¼ãå¿ããã®ãªã³ã¯ç¨ã®ãã¹ããæ¸ãã¨ãããã©ããªãããè¦ã¦ããã¾ãã ååã®ã¨ãã½ã¼ãã®æåã§ã¯ããã°ã¤ã³ãã©ã¼ã ãæã¤ã¢ããªã±ã¼ã·ã§ã³ãããã¾ããããã©ã¼ã ã«ã¯åºæ¬çãªèªè¨¼æ©è½ãããã¾ãããããã°ã¤ã³ç¶æ ãè¨æ¶(remember me)ãã®ãã§ãã¯ããã¯ã¹ã¨ããã¹ã¯ã¼ã
ããã³ã¾ãã¯ã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 ç´
t-wadaã®ããã° 2010/11ç¾å¨ã ã¨ãæåã«ãããåçµããã®ãããã¨ãããã http://d.hatena.ne.jp/t-wada/20100228/p1 ãã³ã¾ã®è¨äº ãã¼ã¸ã§ã³ãå¤ãã®ã§æ³¨æã http://jp.rubyist.net/magazine/?0021-Rspec ãã¼ã¸ã§ã³ Rspec 1.0.8 http://jp.rubyist.net/magazine/?0023-Rspec ãã¼ã¸ã§ã³ rails2.0.2 RSpec 1.1.3 RSpec on Rails 1.1.3 æ¬å®¶ã®document (æ¬å®¶ã£ã¦è¨ãæ¹ãã©ããã¨æãä»æ¥ãã®é ) http://rspec.info/ http://rspec.info/documentation/ http://rspec.info/rails/writing/ æ¬ eBookã®ã¿ã ã¨ã24.00$ã§ã42
ã¯ã¦ãªã°ã«ã¼ãã®çµäºæ¥ã2020å¹´1æ31æ¥(é)ã«æ±ºå®ãã¾ãã 以ä¸ã®ã¨ã³ããªã®éããä»å¹´æ«ãç®å¦ã«ã¯ã¦ãªã°ã«ã¼ããçµäºäºå®ã§ããæ¨ããç¥ãããã¦ããã¾ããã 2019å¹´æ«ãç®å¦ã«ãã¯ã¦ãªã°ã«ã¼ãã®æä¾ãçµäºããäºå®ã§ã - ã¯ã¦ãªã°ã«ã¼ãæ¥è¨ ãã®ãã³ãæ£å¼ã«çµäºæ¥ã決å®ãããã¾ããã®ã§ã以ä¸ã®éãã確èªãã ããã çµäºæ¥: 2020å¹´1æ31æ¥(é) ã¨ã¯ã¹ãã¼ãå¸æç³è«æé:2020å¹´1æ31æ¥(é) çµäºæ¥ä»¥éã¯ãã¯ã¦ãªã°ã«ã¼ãã®é²è¦§ããã³æ稿ã¯è¡ãã¾ãããæ¥è¨ã®ã¨ã¯ã¹ãã¼ããå¿ è¦ãªæ¹ã¯ä»¥ä¸ã®è¨äºã«ãããã£ã¦æç¶ãããã¦ãã ããã ã¯ã¦ãªã°ã«ã¼ãã«æ稿ãããæ¥è¨ãã¼ã¿ã®ã¨ã¯ã¹ãã¼ãã«ã¤ã㦠- ã¯ã¦ãªã°ã«ã¼ãæ¥è¨ ãå©ç¨ã®ã¿ãªãã¾ã«ã¯ãè¿·æãããããããã¾ãããã©ãããããããé¡ããããã¾ãã 2020-06-25 è¿½è¨ ã¯ã¦ãªã°ã«ã¼ãæ¥è¨ã®ã¨ã¯ã¹ãã¼ããã¼ã¿ã¯2020å¹´2æ28
æ°çè¨äº ãRuby on Rails 5.0 åç´â£: HTMLãã©ã¼ã (å¾ç·¨)ãç´çï¼ãã¼ãã¼ããã¯çï¼ãåºã¾ã ï¼2017/08/04ï¼ WordPress 㨠Ruby on Rails ã¯ã©ããã©ãéãã®ã ï¼2017/04/19ï¼ ãå®è·µRuby on Rails 4ãç°å¢æ§ç¯æé for macOSï¼2017å¹´çï¼ ï¼2017/01/24ï¼ ãå®è·µRuby on Rails 4ãç°å¢æ§ç¯æé for Windows ï¼2017å¹´çï¼ ï¼2017/01/24ï¼ Kindleæ¬ãElixir/Phoenix åç´â ããåºçãã¾ãã ï¼2016/11/25ï¼ Kindleåãã«æè¡æ¸ã3ååºãã¦ã¿ã¦æã£ãã㨠ï¼2016/06/08ï¼ åé¡03ã®è§£çã¨è§£èª¬ ï¼2016/03/21ï¼ ããã®ä»ãç¨ã®ããã¹ãå ¥åæ¬ãæã¤é¸æå¼å ¥åæ¬ ï¼2016/02/08ï¼ åé¡02ã®è§£çã¨è§£èª¬ ï¼2
2008å¹´10æ20æ¥02:41 Ruby Linux RSpec + Autotest::screen = æé«ã®éçºç°å¢ ã追è¨090704ã RSpecã§ãã¹ãã³ã¼ããæ¸ããã¾ã¨ã - (ï¾âï¾)o彡 sasata299's blog ãä½µãã¦ã覧ãã ããã éçºã¯ãã¹ããã¡ã¼ã¹ãã§ãããããªããï¼Â´âï½*)ãããæã£ã¦ã¡ãã£ã¨Rubyã®ãã¹ãã«ã¤ãã¦èª¿ã¹ã¦ããããTDDï¼ãã¹ãé§åéçºï¼ã«å¯¾ãã¦ãBDDï¼ããã¤ãã¢é§åéçºï¼ã¨ãããã®ãçºè¦ãã¾ããã ã§ãrubyã®è©±ã«ãªãã¾ãããrubyã«ã¯RSpecã¨ããBDDç¨ã®ãã¬ã¼ã ã¯ã¼ã¯ãããã¾ããRSpecã ãã§ãçµæ§ä¾¿å©ã§ãããã ãããã¯ãã£ã±ããã¡ãã¡ãã¹ããèµ°ããããããã®ãé¢åãªãããªãã§ããããã ããã§ãautotestã®åºçªã§ãï¼ï¼ããã¯ããã¡ã¤ã«ã«å¤æ´ããã£ãããããã«å¯¾å¿ãããã¹ãã³ã¼ããèªåã§èµ°ããã¦ããããã¨ãã
åç° å人(@t_wada) ä½ãRSpec ã®å ¥éã¨ãã®ä¸æ©å ã¸ãã¯ã¯ãªã¨ã¤ãã£ãã»ã³ã¢ã³ãº 表示 - ç¶æ¿ 4.0 å½é ã©ã¤ã»ã³ã¹ã§æä¾ããã¦ãã¾ãã æ±äº¬ Ruby ä¼è° 03 ã® RSpec ã¯ã¼ã¯ã·ã§ããã®è³æã§ãããã®ã¯ã¼ã¯ã·ã§ããã§ã¯åå è ã®æ¹ã«ãåçµã(ã³ã¼ããæ¸ãåããã¨)ããã¦è²°ããTDD/BDD 㨠RSpec ãåæã«å¦ã¹ãããã«é½åº¦èª¬æãå ¥ããããã¡ã§è¡ãã¾ããã 第2ã¤ãã¬ã¼ã·ã§ã³ãæ¸ãã¾ãããç¶ãã«èå³ããæ¹ã¯ã覧ä¸ãã (æ´æ°) 第3ã¤ãã¬ã¼ã·ã§ã³ãæ¸ãã¾ãããç¶ãã«èå³ããæ¹ã¯ã覧ä¸ãã 1st iteration favotter ã® ã¿ãã㪠NG ã¯ã¼ãã®ãã£ã«ã¿ãªã³ã°æ©è½ã RSpec ã§ä½ãã¾ããããã¾ã㯠NG ã¯ã¼ãã®æ¤åºæ©è½ãä½æãã¾ãã ãã®ã¤ãã¬ã¼ã·ã§ã³ã§ã¯æåãã¿ãªå½¢ã®ãã¹ãã³ã¼ãã¨å®è£ ãæ¸ããã ãã ãã¨ãã®ã³ã¼ããæ´ç·´ããã¦ããã¾
2009å¹´07æ01æ¥01:07 Ruby RSpecã§ãã¹ãã³ã¼ããæ¸ããã¾ã¨ã æè¿ã¯ Ruby ã®ãã¹ãã«èå³ããã£ã¦ãããã試ãã¦ãã¾ãã ä»æ°ã«ãªã£ã¦ããã®ã¯ RSpec 㨠Cucumber ã®2ã¤ãä»åã¯ã¾ã RSpec ãè²ã 触ã£ã¦ã¿ãã®ã§ãã®ã¨ãã®ãã°ãã¡ã¢ã£ã¦ã¿ã¾ããRSpec ã«ã¤ãã¦ã¯ RSpec + Autotest::screen = æé«ã®éçºç°å¢ ã§ãæ¸ãã¾ããããBDDï¼æ¯èé§åéçºï¼ã®ãã¬ã¼ã ã¯ã¼ã¯ã§ãdescribe 㨠it ã¨ãã2ã¤ã®ã¡ã½ãããå©ç¨ãã¾ããdescribe ã«ãã¹ããããæ¯èãæ¸ããit ã«ã¯ãã®ã¨ãã«æºããã¹ãä»æ§ãæ¸ãã¨ããæãã§ããä»å㯠Rails 㧠RSpec ã使ã£ããã¹ããæ¸ãã¦ã¿ã¾ãããã(=ï¾Ïï¾)ï¾ äºåæºåã¨ãã¦ãrspec 㨠rspec-rails 㨠Zentestï¼ãã¹ããèªåã§èµ°ãããããããã®ä¸
ãªã¼ãã«ã¸ã¼ãå®é£ã¬ã é£ã¹ç©ã®é¼»å¡©å¡©(æªã ã«éããã®ããª) ãªã¼ãã«ã¸ã¼ãã¨ããã«ã¬ã¼ããåç¥ã ããã é½å ã«ããããªããªã¼å°éã®ã«ã¬ã¼å±ã§ã ãã±å¼ãªã©ã§å¤§äººæ°ã®æ¬æ ¼æ¬§é¢¨ã«ã¬ã¼ã楽ãããããã ãããªã ãããªããªãã¶ã¤ã¤ã¼ é½å ã®å¥´ãã¯ãããªè¯ãã¢ã³é£ã£ã¦ãã®ã 許ããããâ¦â¦â¦
ãªãªã¼ã¹ãé害æ å ±ãªã©ã®ãµã¼ãã¹ã®ãç¥ãã
ææ°ã®äººæ°ã¨ã³ããªã¼ã®é ä¿¡
å¦çãå®è¡ä¸ã§ã
j次ã®ããã¯ãã¼ã¯
kåã®ããã¯ãã¼ã¯
lãã¨ã§èªã
eã³ã¡ã³ãä¸è¦§ãéã
oãã¼ã¸ãéã
{{#tags}}- {{label}}
{{/tags}}