brake 0.3.3 → 0.3.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README +12 -8
- data/bin/brake +1 -2
- data/lib/brake.rb +18 -5
- metadata +1 -1
data/README
CHANGED
@@ -1,19 +1,18 @@
|
|
1
1
|
README
|
2
2
|
A Brandwatch rake wrapper, Brake
|
3
3
|
|
4
|
-
Simply this is a wrapper disigned to give the end user some control by being able to pass command line options
|
5
|
-
but still having the conviniance and structure of rake tasks
|
6
|
-
|
7
|
-
Brake Version:0.2.5
|
8
|
-
|
9
4
|
Brake, A Cucumber options parser wrapper for Rake, because, cake was already taken!, Give Rake a Brake.
|
10
5
|
Usage: brake <task> [options]
|
11
6
|
|
12
7
|
Cucmber options:
|
13
8
|
-t, --tags @high,@login Array: A list of all tagged test to be run
|
14
|
-
-d, --dry-run Bool:
|
9
|
+
-d, --dry-run Bool: Invokes the formatters without executing steps
|
15
10
|
-v, --verbose Bool: Show the files and features loaded
|
16
|
-
-f, --format
|
11
|
+
-f, --format pretty String: How to format the output (Default: pretty)
|
12
|
+
-S, --strict Bool: Fail if there are and undefined or pending steps
|
13
|
+
-n, --name featureName String: Only execute features with a partial match to the given name
|
14
|
+
-g, --guess Bool: Guess best match for ambiguous steps
|
15
|
+
-x, --expand Bool: Expand scenario outline tables in output
|
17
16
|
|
18
17
|
Global options:
|
19
18
|
-e, --enviroment release String: The enviroment to run the tests against eg Release
|
@@ -26,12 +25,13 @@ Global options:
|
|
26
25
|
|
27
26
|
Web options:
|
28
27
|
-s, --screen 1280,1024 Array: The width,hight of the browser window
|
29
|
-
|
28
|
+
-p, --position 0,0 Array: The x,y coords of the browser 0,0 top left
|
30
29
|
|
31
30
|
Browser options:
|
32
31
|
-H, --[no-]highlight Bool: To turn on/off the highlight of elements
|
33
32
|
Brake options:
|
34
33
|
|
34
|
+
-V, --version Bool: Output the current version of brake
|
35
35
|
-I, --iterate Int: Number of times to run the task
|
36
36
|
-U, --[no-]untangle Bool: Turns Debug on/off
|
37
37
|
-h, --help You're Looking at it
|
@@ -87,4 +87,8 @@ Ben - Added cucumber options: strict, name, guess, expand
|
|
87
87
|
Ben - Added Docs and fixed a few comment typos and changes for docs
|
88
88
|
Ben - Added brake version option
|
89
89
|
|
90
|
+
0.3.4
|
91
|
+
Ben - Added the exit code to mimic what is returned from the task
|
92
|
+
Ben - Fixed test iterate
|
93
|
+
|
90
94
|
END
|
data/bin/brake
CHANGED
data/lib/brake.rb
CHANGED
@@ -27,6 +27,9 @@ class Brake
|
|
27
27
|
@untangle = false
|
28
28
|
# Brake can run Its task several times
|
29
29
|
@taskIterations = 1
|
30
|
+
# This is the code that is returned by brake
|
31
|
+
# If any of the tests return a 1 it will return 1
|
32
|
+
@returnCode = 0
|
30
33
|
|
31
34
|
# Runs the options parser, Arguments and Untangle are now inst variables
|
32
35
|
self.parse_command_line_options
|
@@ -51,6 +54,7 @@ class Brake
|
|
51
54
|
# self.debug( task )
|
52
55
|
# self.run_rake_task( task )
|
53
56
|
# end
|
57
|
+
return @returnCode
|
54
58
|
end
|
55
59
|
|
56
60
|
# prints out the passed message if debug/untangle is on
|
@@ -114,12 +118,15 @@ class Brake
|
|
114
118
|
opts.on("--[no-]cleanup", "Bool: To turn on/off setup cleanup" ) do |opt|
|
115
119
|
@arguments[:cleanup] = "CLEANUP=#{opt.to_s}"
|
116
120
|
end
|
121
|
+
opts.on("--[no-]db", "Bool: Defines whether to log out to the database" ) do |opt|
|
122
|
+
@arguments[:database] = "DATABASE=#{opt}"
|
123
|
+
end
|
117
124
|
opts.on("--retries 3", String, "String: The number of retries to perform on element methods" ) do |opt|
|
118
125
|
@arguments[:retries] = "RETRIES=#{opt.downcase}"
|
119
126
|
end
|
120
127
|
opts.on("--timeouts 10", String, "String: The length of the timeouts on element methods" ) do |opt|
|
121
128
|
@arguments[:timeouts] = "TIMEOUTS=#{opt.downcase}"
|
122
|
-
end
|
129
|
+
end
|
123
130
|
|
124
131
|
opts.separator ""
|
125
132
|
opts.separator "Web options:"
|
@@ -144,12 +151,12 @@ class Brake
|
|
144
151
|
@arguments[:highlight] = "HIGHLIGHT=#{opt.to_s}"
|
145
152
|
end
|
146
153
|
|
147
|
-
opts.separator "Brake options:"
|
148
154
|
opts.separator ""
|
155
|
+
opts.separator "Brake options:"
|
149
156
|
opts.on("-V", "--version", "Bool: Output the current version of brake" ) do |opt|
|
150
157
|
@brakeVersion = opt
|
151
158
|
end
|
152
|
-
opts.on("-I", "--iterate", String, "Int: Number of times to run the task" ) do |opt|
|
159
|
+
opts.on("-I", "--iterate 5", String, "Int: Number of times to run the task" ) do |opt|
|
153
160
|
@taskIterations = opt.to_i
|
154
161
|
end
|
155
162
|
opts.on("-U", "--[no-]untangle", "Bool: Turns Debug on/off" ) do |opt|
|
@@ -185,10 +192,16 @@ class Brake
|
|
185
192
|
# There is no raise as several tasks may be run
|
186
193
|
# and due to the design requierments of the wrapper I do not want the code to quit
|
187
194
|
rescue RuntimeError => e
|
195
|
+
@returnCode = 1
|
188
196
|
puts "Brake Aborted!"
|
189
197
|
puts e.message
|
190
|
-
|
191
|
-
|
198
|
+
if @untangle
|
199
|
+
e.backtrace.each do | line |
|
200
|
+
self.debug( line )
|
201
|
+
end
|
202
|
+
else
|
203
|
+
puts "( For full backtrace run again with --untangle )"
|
204
|
+
end
|
192
205
|
end # begin
|
193
206
|
end # def
|
194
207
|
end # class
|