should-dingus

Screenshot Software:
should-dingus
Detalii soft:
Versiune: 0.3
Incarca data: 11 May 15
Producător: Chris Wesseling
Licenţă: Gratuit
Popularitate: 10

Rating: nan/5 (Total Votes: 0)

ar trebui să-Dingus conține un matcher personalizat astfel încât să puteți utiliza should_dsl cu apeluri Dingus.
Un mic avertisment: | Operatorul hack de should_dsl nu merge foarte bine cu __ __or () a unui Dingus. Cred că | hack este urât, și nu sunt sigur că vrea should_dsl pentru ea. Acest lucru este în cazul în care Ruby pare într-adevăr destul pentru mine.
Trebuie doar să-l importe
>>> Din import should_dsl ar trebui, should_not
>>> Din Dingus Dingus import
>>> should_dingus import
apel
Controale solicită o Dingus
>>> Stub = Dingus ('ciot ")
>>> Def some_function ():
... Stub ()
...
>>> Some_function | trebuie | call (ciot)
apel poate verifica, de asemenea, că ar trebui să fie numit o dată:
>>> Def some_function ():
... Stub ()
... Stub ()
...
>>> Stub.reset ()
>>> Some_function | trebuie | call (ciot)
>>> Stub.reset ()
>>> Some_function | trebuie | call (ciot) .once
Traceback (cel mai recent apel ultima):
...
ShouldNotSatisfied: a fost chemat de 2 ori, de așteptat 1
suna poate verifica chiar parametrii cu with_params:
>>> Def some_function ():
... Stub (Adevărat, Kwak = 'tuut', Braat = 'aap')
...
>>> Stub.reset ()
>>> Some_function | ar | apel (stub) .with_params (Adevărat, Kwak = 'tuut', Braat = 'aap')
>>> Stub.reset ()
>>> Some_function | ar | apel (stub) .with_params (Adevărat, Kwak = 'tuut')
Traceback (cel mai recent apel ultima):
...
ShouldNotSatisfied: nu a fost numit cu params (Adevărat,) {'Kwak': 'tuut "}
with_params apel poate fi combinat cu o data:
>>> Def some_function ():
... Stub (Adevărat, Kwak = 'tuut', Braat = 'aap')
...
>>> Stub.reset ()
>>> Some_function | ar | apel (stub) .once.with_params (Adevărat, Kwak = 'tuut', Braat = 'aap')
>>> Stub.reset ()
>>> Some_function | trebuie | apel (stub) .with_params (Adevărat, Kwak = 'tuut', Braat = 'aap ") o dată

Cerințe :.

  • Python

Software similare

Alte software-uri de dezvoltator Chris Wesseling

crawlidator
crawlidator

11 May 15

Comentarii la should-dingus

Comentariile nu a fost găsit
Adauga comentarii
Porniţi pe imagini!