Dab tsi yog spec hauv Ruby?
Dab tsi yog spec hauv Ruby?

Video: Dab tsi yog spec hauv Ruby?

Video: Dab tsi yog spec hauv Ruby?
Video: Tshuaj theem vim li cas thiaj tau nqi ?/ Siv kho mob dab tsi?/paris polyphylla use for? 2024, Kaum ib hlis
Anonim

Cov Ruby Spec Suite, abbreviated ruby / spec , yog ib qho kev xeem suite rau tus cwj pwm ntawm tus Ruby programming lus. Nws tsis yog ib qho kev qhia tshwj xeeb zoo li ISO ib qho, thiab tsis yog lub hom phiaj los ua ib qho. Hloov chaw, nws yog ib qho cuab yeej siv los piav qhia thiab sim tus cwj pwm ntawm Ruby nrog code.

Ntxiv mus, dab tsi yog piav qhia hauv Ruby?

Lo lus piav yog RSpec lo lus tseem ceeb. Nws yog siv los txhais ib qho "Pib Pab Pawg". Koj tuaj yeem xav txog "Pib Pab Pawg" raws li kev sau cov ntawv xeem. Cov piav lo lus tseem ceeb tuaj yeem siv lub npe chav kawm thiab / lossis cov lus sib cav. Lub block tsuas yog ib Ruby block tsim los ntawm cov Ruby do/end keywords.

Tsis tas li ntawd, RSpec yog dab tsi hauv Ruby? RSpec yog ib qho kev xeem rau Ruby , tsim rau kev coj tus cwj pwm-tsav kev loj hlob (BDD). Nws yog lub tsev qiv ntawv sim siv ntau tshaj plaws rau Ruby hauv kev siv ntau lawm. Txawm hais tias nws muaj DSL nplua nuj thiab muaj zog heev (cov lus tshwj xeeb tshwj xeeb), ntawm nws cov tub ntxhais nws yog ib qho cuab yeej yooj yim uas koj tuaj yeem pib siv sai sai.

Ua raws li qhov no hauv kev txiav txim siab, qhov kev sim Ruby yog dab tsi?

Chav tsev kuaj yog ib txoj hauv kev zoo los ntes qhov yuam kev thaum ntxov ntawm txoj kev txhim kho, yog tias koj muab sijhawm rau kev sau ntawv tsim nyog thiab muaj txiaj ntsig kuaj . Ib yam li lwm yam lus, Ruby muab lub moj khaum hauv nws lub tsev qiv ntawv tus qauv rau kev teeb tsa, kev teeb tsa, thiab khiav haujlwm kuaj hu ua Kuaj :: Unit. Ib txoj hauv kev los txhais cov ntawv hla / tsis ua tiav kuaj.

Dab tsi yog qhov feature spec?

Feature spec . Feature specifications yog cov kev ntsuam xyuas qib siab txhais tau hais tias siv cov khoom siv ua haujlwm. los ntawm ib daim ntawv thov. Lawv yuav tsum tsav daim ntawv thov tsuas yog los ntawm nws sab nraud. interface, feem ntau yog cov nplooj ntawv web.

Pom zoo: