cucumberator 0.0.8 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/.travis.yml +7 -0
- data/README.md +21 -11
- data/cucumberator.gemspec +7 -3
- data/features/cucumberize.feature +39 -0
- data/features/exit_all.feature +28 -0
- data/features/force_save.feature +31 -0
- data/features/help.feature +33 -0
- data/features/last_step.feature +23 -0
- data/features/next.feature +38 -0
- data/features/save.feature +88 -0
- data/features/simple_hook.feature +29 -0
- data/features/steps.feature +31 -0
- data/features/support/env.rb +5 -0
- data/features/undo.feature +89 -0
- data/features/where.feature +55 -0
- data/lib/cucumberator.rb +5 -4
- data/lib/cucumberator/commands.rb +14 -0
- data/lib/cucumberator/commands/exit.rb +10 -0
- data/lib/cucumberator/commands/exit_all.rb +11 -0
- data/lib/cucumberator/commands/help.rb +23 -0
- data/lib/cucumberator/commands/last_step.rb +9 -0
- data/lib/cucumberator/commands/next.rb +39 -0
- data/lib/cucumberator/commands/save.rb +80 -0
- data/lib/cucumberator/commands/steps.rb +19 -0
- data/lib/cucumberator/commands/undo.rb +27 -0
- data/lib/cucumberator/commands/where.rb +33 -0
- data/lib/cucumberator/current_step.rb +10 -6
- data/lib/cucumberator/feature_file.rb +27 -0
- data/lib/cucumberator/input.rb +42 -0
- data/lib/cucumberator/parser.rb +61 -0
- data/lib/cucumberator/step_line.rb +29 -0
- data/lib/cucumberator/steps.rb +20 -0
- data/lib/cucumberator/version.rb +1 -1
- metadata +53 -11
- data/lib/cucumberator/writer.rb +0 -260
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fd33d4cd979148095682cd5dbf9105e1f4f4f720
|
4
|
+
data.tar.gz: 17b116517d3783d358bc4b4b9c8ca979c2980016
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4acd1ecca4389109c3ebda242b6056d8f46fa143ae5446f960854240fdc46c9bba7071392fdd34bf0865013fe617996ed82cb4b8724dba24179f4630bef123e5
|
7
|
+
data.tar.gz: 00a422b4c21ad26fb90c4b5762c7236c446bc4e76c4ab298e28d86d286b2afa8cbbbdc1b57f07428525a785ecb8594c06d5594c8a996b32ab4dee4b48f55dfa3
|
data/.gitignore
CHANGED
data/.travis.yml
ADDED
data/README.md
CHANGED
@@ -1,9 +1,14 @@
|
|
1
1
|
Cucumberator is Cucumber extension to write steps in command line, whatch how browser responds to them and save directly to your .feature file.
|
2
2
|
|
3
|
+
[![Gem Version](https://badge.fury.io/rb/cucumberator.png)](http://badge.fury.io/rb/cucumberator)
|
4
|
+
[![Dependency Status](https://gemnasium.com/vidmantas/cucumberator.png)](https://gemnasium.com/vidmantas/cucumberator)
|
5
|
+
[![Code Climate](https://codeclimate.com/github/vidmantas/cucumberator.png)](https://codeclimate.com/github/vidmantas/cucumberator)
|
6
|
+
[![Build Status](https://travis-ci.org/vidmantas/cucumberator.png)](https://travis-ci.org/vidmantas/cucumberator)
|
7
|
+
|
3
8
|
## How to use
|
4
9
|
|
5
|
-
*
|
6
|
-
* Or
|
10
|
+
* Place a step "Then I will write new steps" anywhere in scenario [PREFERRED]
|
11
|
+
* Or put @cucumberize tag in front of **last** scenario you want to append with new steps.
|
7
12
|
* Fire up the cucumber and wait until prompt shows up.
|
8
13
|
* Write a step, watch it happen on the browser!
|
9
14
|
|
@@ -45,10 +50,11 @@ Now use special step in any place:
|
|
45
50
|
Then I will write new steps
|
46
51
|
# ...can be the end or other steps...
|
47
52
|
|
48
|
-
or put @cucumberize before last
|
53
|
+
or put @cucumberize before **last** scenario you want to fill up, for example
|
49
54
|
|
50
|
-
@
|
55
|
+
@cucumberize
|
51
56
|
Scenario: check fancy ajax login
|
57
|
+
Given a user with login of "likeaboss"
|
52
58
|
|
53
59
|
and then run this feature file, watch your console for prompt to show up. Enjoy writing steps on the go!
|
54
60
|
|
@@ -56,17 +62,21 @@ and then run this feature file, watch your console for prompt to show up. Enjoy
|
|
56
62
|
|
57
63
|
Latest cucumberator version supports:
|
58
64
|
|
59
|
-
|
60
|
-
|
65
|
+
* Cucumber >= 1.3
|
66
|
+
* Ruby >= 1.9
|
67
|
+
* JRuby >= 1.7.4 (1.9 mode)
|
68
|
+
* Rubinius >= 2.0.0.w38 (1.9 mode)
|
69
|
+
|
70
|
+
Check for compability details on [Travis](https://travis-ci.org/vidmantas/cucumberator)
|
61
71
|
|
62
|
-
##
|
72
|
+
## Want to contribute?
|
63
73
|
|
64
|
-
|
65
|
-
* refactor Cucumberator::Writer - too fat already
|
74
|
+
Fork the project, run tests with:
|
66
75
|
|
67
|
-
|
76
|
+
bundle exec cucumber features
|
68
77
|
|
69
|
-
|
78
|
+
then code, code, code and provide me a pull request <3
|
79
|
+
...Or just fill in a [ticket](https://github.com/vidmantas/cucumberator/issues)
|
70
80
|
|
71
81
|
## Sponsors
|
72
82
|
|
data/cucumberator.gemspec
CHANGED
@@ -15,9 +15,13 @@ Gem::Specification.new do |s|
|
|
15
15
|
|
16
16
|
s.files = `git ls-files`.split("\n")
|
17
17
|
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
18
|
-
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
18
|
+
s.executables = `git ls-files -- bin/*`.split("\n").map { |f| File.basename(f) }
|
19
19
|
s.require_paths = ["lib"]
|
20
20
|
|
21
|
-
s.
|
22
|
-
|
21
|
+
s.required_ruby_version = ">= 1.9.3"
|
22
|
+
|
23
|
+
s.add_dependency 'cucumber', '> 1.3'
|
24
|
+
|
25
|
+
s.add_development_dependency 'aruba', '~> 0.5.3'
|
26
|
+
s.add_development_dependency 'pry'
|
23
27
|
end
|
@@ -0,0 +1,39 @@
|
|
1
|
+
Feature: step saving
|
2
|
+
Background:
|
3
|
+
Given a file named "examples/support/env.rb" with:
|
4
|
+
"""
|
5
|
+
require 'cucumberator'
|
6
|
+
"""
|
7
|
+
Given a file named "examples/step_definitions/extra.rb" with:
|
8
|
+
"""
|
9
|
+
When(/I do some magical stuff with '(\w+)'/) do |*args|
|
10
|
+
# just example
|
11
|
+
end
|
12
|
+
|
13
|
+
"""
|
14
|
+
Given a file named "examples/cucumberize.feature" with:
|
15
|
+
"""
|
16
|
+
Feature: example
|
17
|
+
@cucumberize
|
18
|
+
Scenario: cucumberize
|
19
|
+
When I do some magical stuff with 'apples'
|
20
|
+
|
21
|
+
"""
|
22
|
+
|
23
|
+
Scenario: autosave after successfull execution
|
24
|
+
When I run `cucumber examples/cucumberize.feature` interactively
|
25
|
+
And I type "When I do some magical stuff with 'chairs'"
|
26
|
+
And I type "exit"
|
27
|
+
Then it should pass with:
|
28
|
+
"""
|
29
|
+
Saved `When I do some magical stuff with 'chairs'` to cucumberize.feature
|
30
|
+
"""
|
31
|
+
And the file "examples/cucumberize.feature" should contain exactly:
|
32
|
+
"""
|
33
|
+
Feature: example
|
34
|
+
@cucumberize
|
35
|
+
Scenario: cucumberize
|
36
|
+
When I do some magical stuff with 'apples'
|
37
|
+
When I do some magical stuff with 'chairs'
|
38
|
+
|
39
|
+
"""
|
@@ -0,0 +1,28 @@
|
|
1
|
+
Feature: exit-all command
|
2
|
+
Background:
|
3
|
+
Given a file named "examples/support/env.rb" with:
|
4
|
+
"""
|
5
|
+
require 'cucumberator'
|
6
|
+
"""
|
7
|
+
Given a file named "examples/exit_all.feature" with:
|
8
|
+
"""
|
9
|
+
Feature: example
|
10
|
+
Scenario: exit-all
|
11
|
+
Then I will write new steps
|
12
|
+
Then I will write new steps
|
13
|
+
Then I will write new steps
|
14
|
+
|
15
|
+
Scenario: should be ignored totally
|
16
|
+
Then I will write new steps
|
17
|
+
Then I will write new steps
|
18
|
+
Then I will write new steps
|
19
|
+
|
20
|
+
"""
|
21
|
+
|
22
|
+
Scenario: check `exit-all` command
|
23
|
+
When I run `cucumber examples/exit_all.feature` interactively
|
24
|
+
And I type "exit-all"
|
25
|
+
Then it should fail with:
|
26
|
+
"""
|
27
|
+
1 scenario (1 skipped)
|
28
|
+
"""
|
@@ -0,0 +1,31 @@
|
|
1
|
+
Feature: save command
|
2
|
+
Background:
|
3
|
+
Given a file named "examples/support/env.rb" with:
|
4
|
+
"""
|
5
|
+
require 'cucumberator'
|
6
|
+
"""
|
7
|
+
Given a file named "examples/save.feature" with:
|
8
|
+
"""
|
9
|
+
Feature: example
|
10
|
+
Scenario: stop where exit
|
11
|
+
Then I will write new steps
|
12
|
+
|
13
|
+
"""
|
14
|
+
|
15
|
+
Scenario: check `save` command
|
16
|
+
When I run `cucumber examples/save.feature` interactively
|
17
|
+
And I type "When I do something extraordinary"
|
18
|
+
And I type "save"
|
19
|
+
And I type "exit"
|
20
|
+
Then it should pass with:
|
21
|
+
"""
|
22
|
+
Saved `When I do something extraordinary` to save.feature
|
23
|
+
"""
|
24
|
+
And the file "examples/save.feature" should contain exactly:
|
25
|
+
"""
|
26
|
+
Feature: example
|
27
|
+
Scenario: stop where exit
|
28
|
+
When I do something extraordinary
|
29
|
+
Then I will write new steps
|
30
|
+
|
31
|
+
"""
|
@@ -0,0 +1,33 @@
|
|
1
|
+
Feature: help command
|
2
|
+
Background:
|
3
|
+
Given a file named "examples/support/env.rb" with:
|
4
|
+
"""
|
5
|
+
require 'cucumberator'
|
6
|
+
"""
|
7
|
+
Given a file named "examples/help.feature" with:
|
8
|
+
"""
|
9
|
+
Feature: example
|
10
|
+
Scenario: help
|
11
|
+
Then I will write new steps
|
12
|
+
|
13
|
+
"""
|
14
|
+
|
15
|
+
Scenario: check help command
|
16
|
+
When I run `cucumber examples/help.feature` interactively
|
17
|
+
And I type "help"
|
18
|
+
And I type "exit"
|
19
|
+
Then it should pass with:
|
20
|
+
"""
|
21
|
+
:: Write a step here and watch it happen on the browser.
|
22
|
+
:: Steps are automatically saved unless it raises exception. Use 'save' to force-save it anyway.
|
23
|
+
:: Available commands:
|
24
|
+
:: save - force-saves last step into current feature file
|
25
|
+
:: last-step - display last executed step (to be saved on 'save' command)
|
26
|
+
:: undo - remove last saved line from feature file
|
27
|
+
:: next - execute next step and stop
|
28
|
+
:: steps - display available steps
|
29
|
+
:: where - display current location in file
|
30
|
+
:: exit - exits current scenario
|
31
|
+
:: exit-all - exists whole Cucumber feature
|
32
|
+
:: help - display this notification
|
33
|
+
"""
|
@@ -0,0 +1,23 @@
|
|
1
|
+
Feature: step saving
|
2
|
+
Background:
|
3
|
+
Given a file named "examples/support/env.rb" with:
|
4
|
+
"""
|
5
|
+
require 'cucumberator'
|
6
|
+
"""
|
7
|
+
|
8
|
+
Scenario: last-step display
|
9
|
+
Given a file named "examples/last_step.feature" with:
|
10
|
+
"""
|
11
|
+
Feature: example
|
12
|
+
Scenario: example
|
13
|
+
Then I will write new steps
|
14
|
+
|
15
|
+
"""
|
16
|
+
When I run `cucumber examples/last_step.feature` interactively
|
17
|
+
And I type "When new step is executed"
|
18
|
+
And I type "last-step"
|
19
|
+
And I type "exit"
|
20
|
+
Then it should pass with:
|
21
|
+
"""
|
22
|
+
It was: `When new step is executed`
|
23
|
+
"""
|
@@ -0,0 +1,38 @@
|
|
1
|
+
Feature: next
|
2
|
+
Background:
|
3
|
+
Given a file named "examples/support/env.rb" with:
|
4
|
+
"""
|
5
|
+
require 'cucumberator'
|
6
|
+
"""
|
7
|
+
Given a file named "examples/step_definitions/extra.rb" with:
|
8
|
+
"""
|
9
|
+
When(/I do some magical stuff with '(\w+)'/) do |*args|
|
10
|
+
# just example
|
11
|
+
end
|
12
|
+
|
13
|
+
"""
|
14
|
+
Given a file named "examples/next.feature" with:
|
15
|
+
"""
|
16
|
+
Feature: example
|
17
|
+
Scenario: stop where exit
|
18
|
+
Then I will write new steps
|
19
|
+
When I do some magical stuff with 'apples'
|
20
|
+
When I do some magical stuff with 'oranges'
|
21
|
+
When I do some magical stuff with 'bananas'
|
22
|
+
When I do some magical stuff with 'water'
|
23
|
+
|
24
|
+
"""
|
25
|
+
|
26
|
+
Scenario: one next
|
27
|
+
When I run `cucumber examples/next.feature` interactively
|
28
|
+
And I type "next"
|
29
|
+
And I type "where"
|
30
|
+
And I type "exit"
|
31
|
+
Then it should pass with:
|
32
|
+
"""
|
33
|
+
examples/next.feature:4:in `When I do some magical stuff with 'apples'
|
34
|
+
"""
|
35
|
+
And it should pass with:
|
36
|
+
"""
|
37
|
+
4: -> When I do some magical stuff with 'apples'
|
38
|
+
"""
|
@@ -0,0 +1,88 @@
|
|
1
|
+
Feature: step saving
|
2
|
+
Background:
|
3
|
+
Given a file named "examples/support/env.rb" with:
|
4
|
+
"""
|
5
|
+
require 'cucumberator'
|
6
|
+
"""
|
7
|
+
Given a file named "examples/step_definitions/extra.rb" with:
|
8
|
+
"""
|
9
|
+
When(/I do some magical stuff with '(\w+)'/) do |*args|
|
10
|
+
# just example
|
11
|
+
end
|
12
|
+
|
13
|
+
"""
|
14
|
+
|
15
|
+
Scenario: autosave after successfull execution
|
16
|
+
Given a file named "examples/autosave.feature" with:
|
17
|
+
"""
|
18
|
+
Feature: example
|
19
|
+
Scenario: stop where exit
|
20
|
+
When I do some magical stuff with 'apples'
|
21
|
+
Then I will write new steps
|
22
|
+
|
23
|
+
"""
|
24
|
+
When I run `cucumber examples/autosave.feature` interactively
|
25
|
+
And I type "When I do some magical stuff with 'chairs'"
|
26
|
+
And I type "exit"
|
27
|
+
Then it should pass with:
|
28
|
+
"""
|
29
|
+
Saved `When I do some magical stuff with 'chairs'` to autosave.feature
|
30
|
+
"""
|
31
|
+
And the file "examples/autosave.feature" should contain exactly:
|
32
|
+
"""
|
33
|
+
Feature: example
|
34
|
+
Scenario: stop where exit
|
35
|
+
When I do some magical stuff with 'apples'
|
36
|
+
When I do some magical stuff with 'chairs'
|
37
|
+
Then I will write new steps
|
38
|
+
|
39
|
+
"""
|
40
|
+
|
41
|
+
Scenario: autosave for empty line
|
42
|
+
Given a file named "examples/autosave_nl.feature" with:
|
43
|
+
"""
|
44
|
+
Feature: example
|
45
|
+
Scenario: stop where exit
|
46
|
+
When I do some magical stuff with 'apples'
|
47
|
+
Then I will write new steps
|
48
|
+
|
49
|
+
"""
|
50
|
+
When I run `cucumber examples/autosave_nl.feature` interactively
|
51
|
+
And I type ""
|
52
|
+
And I type "exit"
|
53
|
+
And the file "examples/autosave_nl.feature" should contain exactly:
|
54
|
+
"""
|
55
|
+
Feature: example
|
56
|
+
Scenario: stop where exit
|
57
|
+
When I do some magical stuff with 'apples'
|
58
|
+
|
59
|
+
Then I will write new steps
|
60
|
+
|
61
|
+
"""
|
62
|
+
|
63
|
+
Scenario: explicit save after step failure
|
64
|
+
Given a file named "examples/autosave_explicit.feature" with:
|
65
|
+
"""
|
66
|
+
Feature: example
|
67
|
+
Scenario: stop where exit
|
68
|
+
When I do some magical stuff with 'apples'
|
69
|
+
Then I will write new steps
|
70
|
+
|
71
|
+
"""
|
72
|
+
When I run `cucumber examples/autosave_explicit.feature` interactively
|
73
|
+
And I type "When new step is executed"
|
74
|
+
And I type "save"
|
75
|
+
And I type "exit"
|
76
|
+
Then it should pass with:
|
77
|
+
"""
|
78
|
+
Saved `When new step is executed` to autosave_explicit.feature
|
79
|
+
"""
|
80
|
+
And the file "examples/autosave_explicit.feature" should contain exactly:
|
81
|
+
"""
|
82
|
+
Feature: example
|
83
|
+
Scenario: stop where exit
|
84
|
+
When I do some magical stuff with 'apples'
|
85
|
+
When new step is executed
|
86
|
+
Then I will write new steps
|
87
|
+
|
88
|
+
"""
|
@@ -0,0 +1,29 @@
|
|
1
|
+
Feature: stop execution on cucumberator step & exit sucessfully
|
2
|
+
Scenario: using cucumberator step, but cucumberator not required
|
3
|
+
Given a file named "examples/simple_hook_test.feature" with:
|
4
|
+
"""
|
5
|
+
Feature: example
|
6
|
+
Scenario: stop and exit
|
7
|
+
Then I will write new steps
|
8
|
+
"""
|
9
|
+
When I run `cucumber examples/simple_hook_test.feature`
|
10
|
+
Then the output should contain "1 step (1 undefined)"
|
11
|
+
|
12
|
+
Scenario: using cucumberator step with cucumberator required
|
13
|
+
Given a file named "examples/simple_hook_test.feature" with:
|
14
|
+
"""
|
15
|
+
Feature: example
|
16
|
+
Scenario: stop and exit
|
17
|
+
Then I will write new steps
|
18
|
+
"""
|
19
|
+
And a file named "examples/support/env.rb" with:
|
20
|
+
"""
|
21
|
+
require 'cucumberator'
|
22
|
+
"""
|
23
|
+
When I run `cucumber examples/simple_hook_test.feature` interactively
|
24
|
+
And I type "exit"
|
25
|
+
Then it should pass with:
|
26
|
+
"""
|
27
|
+
1 scenario (1 passed)
|
28
|
+
1 step (1 passed)
|
29
|
+
"""
|
@@ -0,0 +1,31 @@
|
|
1
|
+
Feature: steps command
|
2
|
+
Background:
|
3
|
+
Given a file named "examples/support/env.rb" with:
|
4
|
+
"""
|
5
|
+
require 'cucumberator'
|
6
|
+
"""
|
7
|
+
Given a file named "examples/step_definitions/extra.rb" with:
|
8
|
+
"""
|
9
|
+
When(/I do some magical stuff with '(\w+)'/) do |*args|
|
10
|
+
# just example
|
11
|
+
end
|
12
|
+
|
13
|
+
"""
|
14
|
+
Given a file named "examples/steps.feature" with:
|
15
|
+
"""
|
16
|
+
Feature: example
|
17
|
+
Scenario: stop where exit
|
18
|
+
Then I will write new steps
|
19
|
+
|
20
|
+
"""
|
21
|
+
|
22
|
+
Scenario: check `steps` command
|
23
|
+
When I run `cucumber examples/steps.feature` interactively
|
24
|
+
And I type "steps"
|
25
|
+
And I type "exit"
|
26
|
+
Then it should pass with:
|
27
|
+
"""
|
28
|
+
:: Yay, you have 2 steps in your pocket:
|
29
|
+
/^I will write new steps$/
|
30
|
+
/I do some magical stuff with '(\w+)'/
|
31
|
+
"""
|