예제 #1
0
파일: dsl_spec.py 프로젝트: msabramo/rgf
 def spec(world):
     example_suite = ExampleSuite()
     ExampleSuite.set_suite(example_suite)
     with describe('Example Group with examples added by it()') as eg:
         decorator = it('Example description created by it()')
         example = decorator(first_test_function)
         assert eg.examples == [example]
예제 #2
0
파일: runner.py 프로젝트: fidothe/rgf
def main():
    formatter = ProgressFormatter(sys.stdout)
    reporter = Reporter(formatter)
    runner = Runner(reporter)
    suite = ExampleSuite.get_suite()

    return runner.run(suite, sys.argv[1])
예제 #3
0
 def b(w):
     def failing_test_function(self):
         assert False
     def error_test_function(self):
         raise KeyError('grrr')
     example_suite = ExampleSuite()
     example_group = example_suite.add_example_group('reports')
     w.ex1 = Example('All good', first_test_function)
     w.ex2 = Example('Fail', failing_test_function)
     w.ex3 = Example('Error', error_test_function)
     example_group.add_example(w.ex1)
     example_group.add_example(w.ex2)
     example_group.add_example(w.ex3)
     io = StringIO()
     w.mock_formatter = MockFormatter()
     w.reporter = Reporter(w.mock_formatter)
     example_suite.run(w.reporter)
예제 #4
0
파일: dsl.py 프로젝트: msabramo/rgf
def _get_current_example_group():
    return ExampleSuite.get_suite().get_current_example_group()
예제 #5
0
 def s(w):
     ExampleSuite.set_suite(w.suite)
     assert ExampleSuite.get_suite() is w.suite
예제 #6
0
 def s(w):
     assert type(ExampleSuite.get_suite()) is ExampleSuite
     assert ExampleSuite.get_suite() is ExampleSuite.get_suite()
예제 #7
0
파일: runner.py 프로젝트: fidothe/rgf
 def collect_to(self, example_suite):
     ExampleSuite.set_suite(example_suite)
     self.import_spec_files()