scalaã§muscle assertçãªã©ã¤ãã©ãªã®è©¦ä½
Scalaã§dogã¨ãããã¹ãã£ã³ã°ãã¬ã¼ã ã¯ã¼ã¯ã以åããä½ã£ã¦ã¿ã¦ããããã§ãããããã¤ã§Persimmon.MuscleAssertã¿ãããªãã¨ã¯ã§ããã®ããªã¨æãä½â¦â¦ããã¨ãã¦æ¾ç½®ãã¦ãããã®ãå°ãæç´ããã¦åãããã«ãã¾ããã
https://github.com/scala-kennel/hound
Diffã®å®è£ èªä½ã¯ãã ã®shapelessã®ããã ã
åæã¯https://github.com/xdotai/diffãããããã«è¦ããã®ã§ãã®ã©ã¤ãã©ãªã使ã£ã¦ããã®ã§ãããæã 使ãã¥ããã£ãããã¾ãæ´æ°é »åº¦é«ããªãããã ã£ããScala.js対å¿ããããã«ãªãã£ããããã®ã§ãDiffãããä½ããã§ãããã¨ãã軽ãæ°æã¡ã§èªä½ã«èµ°ãã¾ããã
ãªãå®è£ ãéãªã®ã§case classã®åãç°ãªãæã«ååãã表示ãããªãã§ãã ãã¨ãshapelessã使ããµãã£ãé¢ä¿ã§ãããããprimitive type + case classããããã表示ã§ããªãåé¡ãããã¾ãâ¦â¦Scalaã§ãªãã¬ã¯ã·ã§ã³ãé å¼µãä½åããªãã§ãâ¦â¦ã
Stringã®åå¥diffã¯ã©ã¤ãã©ãªãã±ã£ã¨æ¢ããªãã£ãã®ã§é対å¿ã§ãã ããããªã©ã¤ãã©ãªãããã°æãã¦ä¸ãã(Javaã®ãã®ã§ãæ§ãã¾ãã)ã
assertionæã«ãªãã¸ã§ã¯ãã®diffãåå¾ããã®ã¯ããã¶ãæåã©ããã®ãã¹ãã£ã³ã°ãã¬ã¼ã ã¯ã¼ã¯ã§ãå®è£ ã§ããã¨æãã¾ãã ããã¾ãéè¦ã¯ãªãããã§ããç§ã¯ä½ãäºå®ã¯ãªãã§ãã ScalaTestã«ã¯power assertããã®ã§ãåºæ¬ã¯ãã£ã¡ã§æºè¶³ãã人ãå¤ãããããªãããªãã¨ã
対象ãJSONã«ç¹åããããªãdiffsonçã使ã£ã¦å®è£ ãããã¨ããæãããã¾ãã