<s> from expects import * <EOL> from doublex_expects import have_been_called_with <EOL> from doublex import Spy <EOL> from spec . object_mother import * <EOL> from mamba import reporter , infrastructure <EOL> from mamba . infrastructure import total_seconds <EOL> with description ( Example ) : <EOL> with before . each : <EOL> self . reporter = Spy ( reporter . Reporter ) <EOL> self . example = an_example ( ) <EOL> with it ( '<STR_LIT>' ) : <EOL> self . example . run ( self . reporter ) <EOL> expect ( self . example . was_run ) . to ( be_true ) <EOL> with it ( '<STR_LIT>' ) : <EOL> self . example . run ( self . reporter ) <EOL> expect ( total_seconds ( self . example . elapsed_time ) ) . to ( be_above ( <NUM_LIT:0> ) ) <EOL> with it ( '<STR_LIT>' ) : <EOL> self . example . run ( self . reporter ) <EOL> expect ( self . reporter . example_started ) . to ( have_been_called_with ( self . example ) ) <EOL> with it ( '<STR_LIT>' ) : <EOL> self . example . run ( self . reporter ) <EOL> expect ( self . reporter . example_passed ) . to ( have_been_called_with ( self . example ) ) <EOL> with context ( '<STR_LIT>' ) : <EOL> with before . each : <EOL> self . example = a_failing_example ( ) <EOL> self . example . run ( self . reporter ) <EOL> with it ( '<STR_LIT>' ) : <EOL> expect ( self . example . was_run ) . to ( be_true ) <EOL> with it ( '<STR_LIT>' ) : <EOL> expect ( self . example . failed ) . to ( be_true ) <EOL> with it ( '<STR_LIT>' ) : <EOL> expect ( self . example . error ) . not_to ( be_none ) <EOL> with it ( '<STR_LIT>' ) : <EOL> expect ( self . reporter . example_failed ) . to ( have_been_called_with ( self . example ) ) </s>
