Permalink
Browse files

Release 1.2.22

  • Loading branch information...
heynemann committed May 13, 2010
1 parent 50c7ecd commit f3bc706f5b4b63df9f0648970adb84826acae0a6
Showing with 67 additions and 2 deletions.
  1. +1 −1 pyccuracy/__init__.py
  2. +1 −1 pyccuracy/pyccuracy_console.py
  3. +65 −0 tests/unit/test_story_runner.py
View
@@ -22,5 +22,5 @@
from pyccuracy.drivers import DriverRegistry
from pyccuracy.drivers.core import *
-Version = "1.2.21"
+Version = "1.2.22"
Release = "Clarytin"
@@ -134,7 +134,7 @@ def main(arguments=sys.argv[1:]):
parser.add_option("-F", "--reportfile", dest="report_file_name", default="report.html", help="Report file. Defines the file name to write the report with [default: %default].")
#verbosity
- parser.add_option("-v", "--verbosity", dest="verbosity", default="2", help="Verbosity. 0 - does not show any output, 1 - shows text progress, 2 - shows animated progress bar, 3 - shows action by action [default: %default].")
+ parser.add_option("-v", "--verbosity", dest="verbosity", default="3", help="Verbosity. 0 - does not show any output, 1 - shows text progress, 2 - shows animated progress bar, 3 - shows action by action [default: %default].")
options, args = parser.parse_args(arguments)
@@ -62,6 +62,19 @@ def test_story_runner_returns_a_result_with_a_Fixture():
context.settings.on_before_action = None
context.settings.on_action_successful = None
context.settings.on_action_error = None
+ context.language = Mock()
+ context.language \
+ .expects(once()) \
+ .get(eq('given')) \
+ .will(return_value('Given'))
+ context.language \
+ .expects(once()) \
+ .get(eq('when')) \
+ .will(return_value('When'))
+ context.language \
+ .expects(once()) \
+ .get(eq('then')) \
+ .will(return_value('Then'))
result = runner.run_stories(settings, fixture, context=context)
@@ -84,6 +97,19 @@ def test_story_runner_returns_a_result_with_the_original_Fixture():
context.settings.on_before_action = None
context.settings.on_action_successful = None
context.settings.on_action_error = None
+ context.language = Mock()
+ context.language \
+ .expects(once()) \
+ .get(eq('given')) \
+ .will(return_value('Given'))
+ context.language \
+ .expects(once()) \
+ .get(eq('when')) \
+ .will(return_value('When'))
+ context.language \
+ .expects(once()) \
+ .get(eq('then')) \
+ .will(return_value('Then'))
result = runner.run_stories(settings, fixture, context=context)
@@ -128,6 +154,19 @@ def test_should_execute_scenarios_successfully():
context.settings.on_before_action = None
context.settings.on_action_successful = None
context.settings.on_action_error = None
+ context.language = Mock()
+ context.language \
+ .expects(once()) \
+ .get(eq('given')) \
+ .will(return_value('Given'))
+ context.language \
+ .expects(once()) \
+ .get(eq('when')) \
+ .will(return_value('When'))
+ context.language \
+ .expects(once()) \
+ .get(eq('then')) \
+ .will(return_value('Then'))
result = runner.run_stories(settings=settings, fixture=fixture, context=context)
@@ -153,6 +192,19 @@ def action_failed_method(context, *args, **kwargs):
context.settings.on_before_action = None
context.settings.on_action_successful = None
context.settings.on_action_error = None
+ context.language = Mock()
+ context.language \
+ .expects(once()) \
+ .get(eq('given')) \
+ .will(return_value('Given'))
+ context.language \
+ .expects(once()) \
+ .get(eq('when')) \
+ .will(return_value('When'))
+ context.language \
+ .expects(once()) \
+ .get(eq('then')) \
+ .will(return_value('Then'))
result = runner.run_stories(settings=settings, fixture=fixture, context=context)
@@ -178,6 +230,19 @@ def action_failed_method(context, *args, **kwargs):
context.settings.on_before_action = None
context.settings.on_action_successful = None
context.settings.on_action_error = None
+ context.language = Mock()
+ context.language \
+ .expects(once()) \
+ .get(eq('given')) \
+ .will(return_value('Given'))
+ context.language \
+ .expects(once()) \
+ .get(eq('when')) \
+ .will(return_value('When'))
+ context.language \
+ .expects(once()) \
+ .get(eq('then')) \
+ .will(return_value('Then'))
result = runner.run_stories(settings=settings, fixture=fixture, context=context)

0 comments on commit f3bc706

Please sign in to comment.