Allow the dry run mode

Registered by Joël Grand-Guillaume @ camptocamp

We'll need to support the dry-run mode of cucumber. This will be used for lots of things, but mainly to list the existing defined steps with the following command for example:

cucumber -d -f stepdefs

This will allow people to know which sentences has already been defined to ease the test writing. Thanks to Fabien Lydoire for this idea ;)

I already test this little "bad" patch to test it can be done and it works. We need now a "clean" way to deal with that dry-run mode.

Here is my patch :

=== modified file 'features/_basic/step_definitions/_init.rb'
--- features/_basic/step_definitions/_init.rb 2010-03-18 12:07:58 +0000
+++ features/_basic/step_definitions/_init.rb 2010-07-07 10:48:45 +0000
@@ -19,18 +19,25 @@
 #
 ##############################################################################
 unless $utils
+ begin
     $utils = ScenarioUtils.new
+ rescue Exception => e
+ puts 'No ScenarioUtils loaded, probably --dry-run option mode'
+ end
 end
 Before do
     if not $utils :
- $utils = ScenarioUtils.new
- puts 'reset connection'
+ begin
+ $utils = ScenarioUtils.new
+ puts 'No ScenarioUtils loaded, probably --dry-run option mode'
+ rescue
+ puts ''
+ end
     end
     @res = false
     @part = false
     @account_id = false
     @prod = false
-
 end

 ##############################################################################

Blueprint information

Status:
Not started
Approver:
Joël Grand-Guillaume @ camptocamp
Priority:
Undefined
Drafter:
Joël Grand-Guillaume @ camptocamp
Direction:
Needs approval
Assignee:
None
Definition:
Approved
Series goal:
None
Implementation:
Unknown
Milestone target:
None

Related branches

Sprints

Whiteboard

(?)

Work Items

This blueprint contains Public information 
Everyone can see this information.

Subscribers

No subscribers.