pycukes.Pyhistorian ¸Ç À§¿¡ Áö¾îÁø ¿ÀÀÌ¿Í °°Àº BDD ÇÁ·¹ÀÓ ¿öÅ© | |
Áö±Ý ´Ù¿î·Îµå |
pycukes. ¼øÀ§ ¹× ¿ä¾à
±¤°í
- ƯÇã:
- MIT/X Consortium Lic...
- °¡°Ý:
- FREE
- °Ô½ÃÀÚ À̸§:
- Hugo Lopes Tavares
- °Ô½ÃÀÚ À¥»çÀÌÆ®:
- http://github.com/hugobr/
pycukes. ű×
pycukes. ¼³¸í
Pyhistorian ¸Ç À§¿¡ Áö¾îÁø ¿ÀÀÌ °°Àº BDD ÇÁ·¹ÀÓ ¿öÅ© Pycukes´Â Pyhistorian ¸Ç À§¿¡ ±¸Ãà µÈ ¿ÀÀÌ °°Àº BDD µµ±¸ÀÔ´Ï´Ù. Pyhistorian.Usage¿Í °°Àº °£´ÜÇÑ ºøÁú ÇÒ ¼ö¾ø´Â ÆÄÀ̽ã ÆÄÀÏ ´ë½Å °£´ÜÇÑ ºøÁú °¡´É¼ºÀÖ´Â Python ÆÄÀÏ ´ë½Å ÅؽºÆ® ÆÄÀÏ·Î ÀÌÇØ °ü°èÀÚ¿Í À̾߱âÇÏ´Â °ÍÀÌ °¡´ÉÇÕ´Ï´Ù. ±âº»ÀûÀ¸·Î ¸í·É ÁÙ¿¡¼ ¸í·É ÁÙ¿¡¼ ÀϺΠDIR·Î Àüȸ¦ °É¸é Stories Dir (Stories ÆÄÀÏÀÌ ÀÖÀ½)À» ãÀº ´ÙÀ½ step_definitions dir (´Ü°è Á¤ÀÇ°¡ ÀÖÀ½À» ±â´ëÇÏ°í ÀÖÀ½)À» ã½À´Ï´Ù. ÄÁº¥¼Çº°·Î °¢ À̾߱â ÆÄÀÏÀº °è»ê±â¿Í °°Àº .STORY¿Í °°Àº .STORY°¡ ³¡³ª°í °¢ ´Ü°è Á¤ÀÇ´Â calculator_steps.py.so¿Í °°ÀÌ ´Ü°èÀûÀ¸·Î ³¡³ª¾ßÇÕ´Ï´Ù. µð·ºÅ丮 Æ®¸®°¡ ÀÖ´Ù°í °¡Á¤ ÇØ º¾½Ã´Ù. | - °è»ê±â`- À̾߱â | - - calculator.story` - step_definitions | - calculator_steps.py ½ºÅ丮¸¦ ½ÇÇàÇÏ·Á¸é °£´ÜÇÑ Åëȸ¦ ÇÒ ¼ö ÀÖ½À´Ï´Ù : pycukesor runÀ» Á¤È®ÇÏ°Ô ÁöÁ¤ÇÒ ¼öÀÖ´Â °æ¿ì pycukes stories / calculator.storyparameters : -s ¶Ç´Â --stories-dir - Stories Directory-T ¶Ç´Â -steps-dir - ´Ü°è Á¤ÀÇ Directory-N ¶Ç´Â -no »ö»óÀ» ÁöÁ¤ÇϽʽÿÀ. n ¶Ç´Â -no-colors - Ä÷¯ Output-N ¶Ç´Â - Colored (±âº»°ª)¸¦ Ç¥½ÃÇÏÁö ¾Êµµ·Ï Pycukes¿¡ ¾Ë·ÁÁÝ´Ï´Ù. Ä÷¯ Ãâ·Â -L ¶Ç´Â ¾ð¾î Ç¥½Ã (ko-kay ±âº»°ª) - ½ºÅ丮 ¾ð¾î ÁöÁ¤ ½ÇÁ¦ ¿¹ : µð·ºÅ丮 Æ®¸® : Hugo @ hugo-laptop : ~ / app $ tree .`- tories | - bowling_game.story` - step_definitions`- bowling_game_steps.pycontentÀÇ bowling_game.story ÆÄÀÏ : Hugo @ hugo-laptop : ~ / app $ cat stories / bowling_game.storystory : º¼¸µ °ÔÀÓ º¼¸µ Ç÷¹À̾î·Î¼ ³ª´Â ¿Â¶óÀο¡¼ º¼¸µÀ»ÇÏ°í ½Í¾îÇÕ´Ï´Ù. ±×·¡¼ ³ª´Â ¼¼°è ½Ã³ª¸®¿À 1ÀÇ ¸ðµç »ç¶÷µé°ú ³î ¼ö ÀÖ½À´Ï´Ù : ³ª´Â º¼¸µ °ÔÀÓÀ»ÇÏÁö ¾ÊÀ» ¶§ º¼¸µ °ÔÀÓÀ»ÇÏ°í ÀÖ½À´Ï´Ù. -laptop : ~ / app $ cat stories / step_definitions / bowling_game_steps.pyfrom pycukes °¡Á® ¿À±â * class bowlinggame (°´Ã¼) : Á¡¼ö = 1 DEF È÷Æ® (ÀÚü, °ø) : pass @ vector ( 'º¼¸µ °ÔÀÓ Àç»ý Áß') def start_game (context._bowling_game = bowlinggame () @ ( '³ª´Â °øÀ» È÷Æ®') def hit_no_balls (context) : context._bowling_game.hit (0) @then ( '0 Á¡ÀÌ ÀÖÀ½') DEF i_HAVE_ZERO_POINTS (ÄÁÅؽºÆ®) : assert context._bowling_game.score == 0running : Hugo @ hugo-laptop : ~ / app $ pycukes À̾߱â / bowling_game.storystory : º¼¸µ °ÔÀÓ º¼¸µ Ç÷¹À̾î·Î¼ ³ª´Â ¿Â¶óÀο¡¼ º¼¸µÀ»ÇÏ°í ½Í½À´Ï´Ù ±×·¡¼ ³ª´Â ¼¼°è ¸ðµÎ¿Í ÇÔ²² ÇÒ ¼ö ÀÖµµ·Ï ¿Â¶óÀÎÀ¸·Î º¼¸µÀ»ÇÏ°í ½Í½À´Ï´Ù. ½Ã³ª¸®¿À 1 : Àú´Â º¼¸µ °ÔÀÓÀ»ÇÏ°í ÀÖ½À´Ï´Ù ... ³ª´Â º¼¸µ °ÔÀÓÀ»ÇÏ°í ÀÖ½À´Ï´Ù ... ³ª´Â °øÀ» µéÀÌÁö ¾ÊÀ» ¶§ ... OK´Â 0 Á¡ÀÌ ÀÖ½À´Ï´Ù ... ½ÇÆÐÇÑ ½ÇÆÐ : ÆÄÀÏ "stories / step_definiti ONS / Bowling_game_steps.py ", LINE 19, I_HAVE_ZERO_POINTS assert context._bowling_game.score == 0 AssertionError RAN 1 ½Ã³ª¸®¿À°¡ 1 Àå¾Ö, 0 ¿À·ù ¹× 0 º¸·ù ´Ü°è ¿ä±¸ »çÇ× : ¡¤ ÆÄÀ̽ã
pycukes. °ü·Ã ¼ÒÇÁÆ®¿þ¾î