spreewald 0.10.0 → 1.0.0
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.
- checksums.yaml +5 -13
- data/README.md +14 -4
- data/bin/spreewald +31 -0
- data/lib/spreewald_support/version.rb +1 -1
- data/support/documentation_generator.rb +4 -2
- metadata +15 -13
checksums.yaml
CHANGED
@@ -1,15 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
|
5
|
-
data.tar.gz: !binary |-
|
6
|
-
ZWYyZWRhNjEzNjZmODI2YjkxOGI4ZmRhYTM4NjI5ZjM1MzNlYzM0Zg==
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 8b63ce4a7ddbfea13889da72f1eefe2c5a75a605
|
4
|
+
data.tar.gz: e1c50a3738d0c9445124097126096cc2196c50ef
|
7
5
|
SHA512:
|
8
|
-
metadata.gz:
|
9
|
-
|
10
|
-
YWUxOThhZWVhMWVmMzVmZDI2NTFlMGFhMGVkZTdmODllMjFjODg3ZjgzOTI1
|
11
|
-
YjA4NmZjM2ZlZmE5ZWE5OWIwZjZhNjE5ZGZlZjM5OGNkZTYzNWM=
|
12
|
-
data.tar.gz: !binary |-
|
13
|
-
MTI1MWY5M2QxNzUyZTY0MDRkYTUwYjc1NDEzMjU2MzAzZDFkNTVkOTFlZTk3
|
14
|
-
YTM3NzcxODBiNzk4ZjM5YmQwYWQyYzY1MjE0N2FkOTQ4ZGIzMWIyMWE3MTY2
|
15
|
-
ZDhlNzQ2NTkwNGQ2MjhjOGY5MDVkYzhjZjU2MDZlMDBjYjBkNTU=
|
6
|
+
metadata.gz: 1604b9ed7790c7268a6c80930888eb9a0e7ff48118c27f1f4ec348aa34cee27c4db3a74e65f63ca598e6c84dc56fd68165fdd5f8451830ec9c3e7460fec886e6
|
7
|
+
data.tar.gz: 9c20207d38e5490159f173aa4d43341a7dbe8c917ea45045ff4b969d907ded3b3252e8d0021536542ba8e0958c5f57c986ad27d946eec6c9744e9acbad8a111c
|
data/README.md
CHANGED
@@ -29,6 +29,16 @@ Alternatively, you can require everything by doing
|
|
29
29
|
require 'spreewald/all_steps'
|
30
30
|
|
31
31
|
|
32
|
+
## Spreewald binary
|
33
|
+
|
34
|
+
Spreewald comes with a binary that prints a list of all Spreewald steps. It will filter the list by any string you pass it. Example usage:
|
35
|
+
|
36
|
+
```bash
|
37
|
+
spreewald # lists all steps
|
38
|
+
spreewald mail # lists all steps that contain "mail"
|
39
|
+
```
|
40
|
+
|
41
|
+
|
32
42
|
## Waiting for page load
|
33
43
|
|
34
44
|
Spreewald's web steps are all aware that you might run them with a Selenium/Capybara webdriver, and wait for the browser to finish loading the page, if necessary.
|
@@ -253,7 +263,7 @@ deprecation notice. Decide for yourself whether you want to use them:
|
|
253
263
|
|
254
264
|
|
255
265
|
|
256
|
-
* **When ... within
|
266
|
+
* **When ... within ...**
|
257
267
|
|
258
268
|
You can append `within [selector]` to any other web step
|
259
269
|
|
@@ -366,7 +376,7 @@ deprecation notice. Decide for yourself whether you want to use them:
|
|
366
376
|
Checks that an input field contains some value (allowing * as wildcard character)
|
367
377
|
|
368
378
|
|
369
|
-
* **Then(the "
|
379
|
+
* **Then(the "..." field should (not )?contain:)**
|
370
380
|
|
371
381
|
Checks that a multiline textarea contains some value (allowing * as wildcard character)
|
372
382
|
|
@@ -424,7 +434,7 @@ deprecation notice. Decide for yourself whether you want to use them:
|
|
424
434
|
Checks for the existance of an input field (given its id or label)
|
425
435
|
|
426
436
|
|
427
|
-
* **Then I should( not)? see the (number|amount) ([\-\d,\.]+)(
|
437
|
+
* **Then I should( not)? see the (number|amount) ([\-\d,\.]+)( ...)?**
|
428
438
|
|
429
439
|
Use this step to test for a number or money amount instead of a simple `Then I should see`
|
430
440
|
|
@@ -460,7 +470,7 @@ deprecation notice. Decide for yourself whether you want to use them:
|
|
460
470
|
Checks for the presence of an option in a select
|
461
471
|
|
462
472
|
|
463
|
-
* **Then I should see '
|
473
|
+
* **Then I should see '...'**
|
464
474
|
|
465
475
|
Like `Then I should see`, but with single instead of double quotes. In case
|
466
476
|
the expected string contains quotes as well.
|
data/bin/spreewald
ADDED
@@ -0,0 +1,31 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
require File.expand_path('../../support/documentation_generator', __FILE__)
|
3
|
+
|
4
|
+
ORDERED_KINDS = %w[Given When Then]
|
5
|
+
heading = 'All Spreewald steps'
|
6
|
+
search_string = ARGV.shift
|
7
|
+
|
8
|
+
# collect
|
9
|
+
steps_glob = File.expand_path('../../lib/spreewald/*_steps.rb', __FILE__)
|
10
|
+
step_names = `cat #{steps_glob}`.split($/).select { |line| line =~ /^(Given|When|Then)/ }
|
11
|
+
|
12
|
+
# format
|
13
|
+
step_names.map! do |step|
|
14
|
+
DocumentationGenerator::StepDefinition.try_and_parse(step).format_definition
|
15
|
+
end
|
16
|
+
|
17
|
+
# sort
|
18
|
+
step_names = step_names.sort_by do |step|
|
19
|
+
step =~ /^(\w+)(.*)/
|
20
|
+
[ORDERED_KINDS.index($1), $2]
|
21
|
+
end
|
22
|
+
|
23
|
+
# filter
|
24
|
+
if search_string
|
25
|
+
heading << " containing '#{search_string}'"
|
26
|
+
step_names = step_names.grep Regexp.new(search_string)
|
27
|
+
end
|
28
|
+
|
29
|
+
# Output
|
30
|
+
puts "\e[4;34m\n# #{heading}\e[0m" # blue underline
|
31
|
+
puts step_names
|
@@ -38,14 +38,16 @@ module DocumentationGenerator
|
|
38
38
|
if @definition =~ /AfterStep/
|
39
39
|
@definition[/@\w*/]
|
40
40
|
else
|
41
|
+
capture_groups = %w[([^\"]*) ([^"]*) (.*) (.*?) [^"]+ ([^\"]+) ([^']*) ([^/]*) (.+) (.*[^:])]
|
42
|
+
capture_groups.map! &Regexp.method(:escape)
|
43
|
+
|
41
44
|
@definition.
|
42
45
|
gsub('/^', '').
|
43
46
|
gsub('$/', '').
|
44
47
|
gsub(' ?', ' ').
|
45
|
-
gsub(/\(\[\^\\?"\](\*|\+)\)/, '...').
|
46
48
|
gsub('(?:|I )', 'I ').
|
47
49
|
gsub('?:', '').
|
48
|
-
gsub(
|
50
|
+
gsub(Regexp.new(capture_groups.join '|'), '...').
|
49
51
|
gsub(/\\\//, '/')
|
50
52
|
end
|
51
53
|
end
|
metadata
CHANGED
@@ -1,69 +1,71 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: spreewald
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tobias Kraze
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-07-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: cucumber-rails
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '0'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: cucumber
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '0'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
38
|
+
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: capybara
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- -
|
45
|
+
- - ">="
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: '0'
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- -
|
52
|
+
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0'
|
55
55
|
description: A collection of cucumber steps we use in our projects, including steps
|
56
56
|
to check HTML, tables, emails and some utility methods.
|
57
57
|
email:
|
58
58
|
- tobias@kraze.eu
|
59
|
-
executables:
|
59
|
+
executables:
|
60
|
+
- spreewald
|
60
61
|
extensions: []
|
61
62
|
extra_rdoc_files: []
|
62
63
|
files:
|
63
|
-
- .gitignore
|
64
|
+
- ".gitignore"
|
64
65
|
- LICENSE
|
65
66
|
- README.md
|
66
67
|
- Rakefile
|
68
|
+
- bin/spreewald
|
67
69
|
- examples/paths.rb
|
68
70
|
- examples/selectors.rb
|
69
71
|
- lib/spreewald.rb
|
@@ -150,17 +152,17 @@ require_paths:
|
|
150
152
|
- lib
|
151
153
|
required_ruby_version: !ruby/object:Gem::Requirement
|
152
154
|
requirements:
|
153
|
-
- -
|
155
|
+
- - ">="
|
154
156
|
- !ruby/object:Gem::Version
|
155
157
|
version: '0'
|
156
158
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
157
159
|
requirements:
|
158
|
-
- -
|
160
|
+
- - ">="
|
159
161
|
- !ruby/object:Gem::Version
|
160
162
|
version: '0'
|
161
163
|
requirements: []
|
162
164
|
rubyforge_project:
|
163
|
-
rubygems_version: 2.2.
|
165
|
+
rubygems_version: 2.2.2
|
164
166
|
signing_key:
|
165
167
|
specification_version: 4
|
166
168
|
summary: Collection of useful cucumber steps.
|