ç¹ã«å¤§ãããªè©±ã§ã¯ãªãã
æè¿ç¡æèã«ãã£ã¦ãããã¨ã«ãèªåã§æ°ã¥ããã®ã ãã©ããã¹ããæ¸ãã¦ããã¨ãã«
ãæ¡ä»¶Aã§æ¡ä»¶Bã§æ¡ä»¶~Cã®ã¨ãã«çµæXã¨çµæYã«ãªããã¹ããæ¸ããããã ãã©ã使ãããã£ã¯ã¹ãã£ã¯ãªãããªããããããã£ããã£ããããã使ããã
ããã§ãã¹ããæ¸ãã¨ããã®ãã£ã¯ã¹ãã£ã«ã¯ããã¹ãã¨é¢ä¿ãªãæ¡ä»¶Dã¨æ¡ä»¶~Eãå«ã¾ãã¦ããããããå¾ã§ãã¹ããèªãã ã¨ã
ããµããããã ã¨æ¡ä»¶Dã®å ´åã«ãªã£ã¦ãããæ¡ä»¶~Dã®ãã¹ãã¯ãããªãã®ããªï¼ã
ã¨ãèããã¡ããããã¯ããããæ¡ä»¶~Cã«æå³ããããã¨ãè¦è½ã¨ãã®ããæãã
ãªã®ã§ããã¹ãã³ã¼ãããããªãµãã«ãã¦ããã
def test_foo # ãã£ã¯ã¹ãã£ã®æºå assert A assert B assert !C # ãã¹ãå®è¡ assert X assert Y end
ããæ¸ããã¨ã§ããã£ã¯ã¹ãã£ã«ã©ããªæå¾ ããã¦ããããæ示çã«ãªããã¾ãããªã«ãã®çç±ã§ãã£ã¯ã¹ãã£ãå£ãã¦åææ¡ä»¶ãæºãããªããªã£ãã¨ãããã¹ãã確å®ã«è½ã¡ãããã«ããªããfail fast ã®ææ³ã§ããã
ãã¹ãã«ã¯ä»æ§ãæ¸ãããã®çºæ³ããããã°ãã¾ãå½ç¶ãªã®ããªãã¿ããªãã£ã¦ãã®ãããããRSpecã®äººã¯ã©ããã¦ããã ããã
ãã¹ãã«ä»æ§ãæ¸ãã¨ãã®åé¡ã®ã²ã¨ã¤ãããã¹ãã¯ããã¾ã§ãå®å ¨ã«å ·ä½çãªä¾ãã§ãã£ã¦ããµã³ããªã³ã°ã«ãããªããªããã¨ãä¾ã«ãªããã¨ã¯æ¨æ¸¬ãããããªãã®ã ãã©ãæ¨æ¸¬ã¯èª¤è§£ã®ãã¨ããã¹ãèªä½ãèªã¿ããããã(誤解ãé¿ãããããã)ãã¨ã¯ããã¹ãã®è³ç£ä¾¡å¤ãä¸ããããã«éè¦ã§ããã
ãããã¨ãããããèªåããã£ã¯ã¹ãã£ã誤èªãã¡ãã£ãã¨ãã«ããå©ãã¦ããããã