gurke 2.4.2 → 3.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 -5
- data/CHANGELOG.md +4 -0
- data/bin/gurke +2 -0
- data/features/gurke.feature +2 -5
- data/features/gurke.rb +2 -1
- data/features/gurke/backtrace_filtering.feature +3 -4
- data/features/gurke/context_in_hooks.feature +1 -2
- data/features/gurke/filter_by_tags.feature +5 -6
- data/features/gurke/include_by_tags.feature +1 -2
- data/features/gurke/other_reporter.feature +3 -4
- data/features/gurke/pending_steps.feature +1 -4
- data/features/gurke/run_specific_directories.feature +4 -5
- data/features/gurke/run_specific_scenarios.feature +5 -6
- data/features/gurke/step_specific_definitions.feature +1 -4
- data/features/support/steps/cli_steps.rb +17 -8
- data/features/support/steps/file_steps.rb +2 -9
- data/gurke.gemspec +10 -9
- data/lib/gurke.rb +3 -0
- data/lib/gurke/background.rb +2 -0
- data/lib/gurke/builder.rb +10 -11
- data/lib/gurke/capybara.rb +2 -0
- data/lib/gurke/cli.rb +35 -27
- data/lib/gurke/configuration.rb +9 -6
- data/lib/gurke/dsl.rb +9 -5
- data/lib/gurke/feature.rb +6 -8
- data/lib/gurke/feature_list.rb +11 -7
- data/lib/gurke/reporter.rb +41 -34
- data/lib/gurke/reporters/compact_reporter.rb +137 -0
- data/lib/gurke/reporters/default_reporter.rb +57 -16
- data/lib/gurke/reporters/null_reporter.rb +4 -2
- data/lib/gurke/reporters/team_city_reporter.rb +11 -13
- data/lib/gurke/rspec.rb +2 -0
- data/lib/gurke/run_list.rb +2 -0
- data/lib/gurke/runner.rb +12 -6
- data/lib/gurke/scenario.rb +41 -2
- data/lib/gurke/step.rb +24 -14
- data/lib/gurke/step_definition.rb +3 -1
- data/lib/gurke/steps.rb +3 -1
- data/lib/gurke/tag.rb +5 -1
- data/lib/gurke/version.rb +5 -3
- data/spec/gurke/feature_list_spec.rb +4 -2
- data/spec/gurke/reporters/default_reporter_spec.rb +201 -0
- data/spec/gurke/run_list_spec.rb +2 -0
- data/spec/gurke/scenario_spec.rb +5 -3
- data/spec/gurke/step_definition_spec.rb +3 -1
- data/spec/spec_helper.rb +10 -1
- metadata +8 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 67753800c554ed5230279ea3fedb0765c04bdbebb23e0adcfe51d39aa171e943
|
4
|
+
data.tar.gz: 1272789c4796298eccbea8d1c4b7993d09e5adb67be6d1c9750e7b9fc0c57837
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 68edef2b0fd8b60b87dca69ac2a6bd2bfbed63ea58d9c0a0484a72e1a4aea5713a673a0eb46b182ba0ffa006002d7db991d5e842504827bea841365e6ffb28cd
|
7
|
+
data.tar.gz: 9c3f090fd25a651f46d85e11864d539379af2977c9d2174a3bf23fd542933af388336cd0a7f968d40e2330bab234c792645dd21999e2ac6710e1d422b1c7f9f2
|
data/CHANGELOG.md
CHANGED
data/bin/gurke
CHANGED
data/features/gurke.feature
CHANGED
@@ -3,9 +3,6 @@ Feature: Use gurke
|
|
3
3
|
In order to run my feature definitions
|
4
4
|
I want to use the gurke command line program
|
5
5
|
|
6
|
-
Background:
|
7
|
-
Given I am in a project using gurke
|
8
|
-
|
9
6
|
Scenario: Run a passing feature file
|
10
7
|
Given a file "features/test.feature" with the following content exists
|
11
8
|
"""
|
@@ -20,7 +17,7 @@ Feature: Use gurke
|
|
20
17
|
end
|
21
18
|
Gurke.configure{|c| c.include TestSteps }
|
22
19
|
"""
|
23
|
-
When I
|
20
|
+
When I run the tests
|
24
21
|
Then the program exit code should be null
|
25
22
|
And the program output should include "Feature: F"
|
26
23
|
And the program output should include "Scenario: Scenario A"
|
@@ -42,6 +39,6 @@ Feature: Use gurke
|
|
42
39
|
end
|
43
40
|
Gurke.configure{|c| c.include TestSteps }
|
44
41
|
"""
|
45
|
-
When I
|
42
|
+
When I run the tests
|
46
43
|
And the program output should include "1 scenarios: 1 failing, 0 pending"
|
47
44
|
Then the program exit code should be non-null
|
data/features/gurke.rb
CHANGED
@@ -4,7 +4,6 @@ Feature: Backtrace filtering
|
|
4
4
|
I want to see modified backtraces with only non-library calls
|
5
5
|
|
6
6
|
Background:
|
7
|
-
Given I am in a project using gurke
|
8
7
|
And a file "features/test.feature" with the following content exists
|
9
8
|
"""
|
10
9
|
Feature: F
|
@@ -21,16 +20,16 @@ Feature: Backtrace filtering
|
|
21
20
|
"""
|
22
21
|
|
23
22
|
Scenario: See backtrace without line from libraries
|
24
|
-
When I
|
23
|
+
When I run the tests
|
25
24
|
Then the program output should include "features/support/steps/test_steps.rb:2"
|
26
25
|
Then the program output should not include "gurke/lib/gurke/runner.rb"
|
27
26
|
|
28
27
|
Scenario: See backtrace when run with --backtrace
|
29
|
-
When I
|
28
|
+
When I run the tests with "--backtrace"
|
30
29
|
Then the program output should include "features/support/steps/test_steps.rb:2"
|
31
30
|
Then the program output should include "gurke/lib/gurke/runner.rb"
|
32
31
|
|
33
32
|
Scenario: See backtrace when run with -b
|
34
|
-
When I
|
33
|
+
When I run the tests with "-b"
|
35
34
|
Then the program output should include "features/support/steps/test_steps.rb:2"
|
36
35
|
Then the program output should include "gurke/lib/gurke/runner.rb"
|
@@ -4,7 +4,6 @@ Feature: Access context in hooks
|
|
4
4
|
I want to access meta data of the context in hooks
|
5
5
|
|
6
6
|
Background:
|
7
|
-
Given I am in a project using gurke
|
8
7
|
And a file "features/test.feature" with the following content exists
|
9
8
|
"""
|
10
9
|
Feature: A
|
@@ -35,5 +34,5 @@ Feature: Access context in hooks
|
|
35
34
|
"""
|
36
35
|
|
37
36
|
Scenario: Assertions should pass
|
38
|
-
When I
|
37
|
+
When I run the tests
|
39
38
|
Then all scenarios have passed
|
@@ -4,7 +4,6 @@ Feature: Backtrace filtering
|
|
4
4
|
I want to filter features and scenarios by tags to only run a subset
|
5
5
|
|
6
6
|
Background:
|
7
|
-
Given I am in a project using gurke
|
8
7
|
And a file "features/support/steps/test_steps.rb" with the following content exists
|
9
8
|
"""
|
10
9
|
module TestSteps
|
@@ -35,35 +34,35 @@ Feature: Backtrace filtering
|
|
35
34
|
"""
|
36
35
|
|
37
36
|
Scenario: Do not run @wip by default
|
38
|
-
When I
|
37
|
+
When I run the tests
|
39
38
|
Then the program output should include "Feature Flagged little-A"
|
40
39
|
And the program output should include "Feature Flagged little-B"
|
41
40
|
And the program output should not include "Feature Flagged little-WIP"
|
42
41
|
And the program output should include "2 scenarios"
|
43
42
|
|
44
43
|
Scenario: Filter with positive tag match
|
45
|
-
When I
|
44
|
+
When I run the tests with "--tags a"
|
46
45
|
Then the program output should include "Feature Flagged little-A"
|
47
46
|
And the program output should not include "Feature Flagged little-B"
|
48
47
|
And the program output should not include "Feature Flagged little-WIP"
|
49
48
|
And the program output should include "1 scenarios"
|
50
49
|
|
51
50
|
Scenario: Filter with negative tag match
|
52
|
-
When I
|
51
|
+
When I run the tests with "-t ~b"
|
53
52
|
Then the program output should include "Feature Flagged little-A"
|
54
53
|
And the program output should not include "Feature Flagged little-B"
|
55
54
|
And the program output should include "Feature Flagged little-WIP"
|
56
55
|
And the program output should include "2 scenarios"
|
57
56
|
|
58
57
|
Scenario: Filter with multiple tag match and'ed
|
59
|
-
When I
|
58
|
+
When I run the tests with "--tags c,d"
|
60
59
|
Then the program output should include "Feature Flagged little-A"
|
61
60
|
And the program output should include "Feature Flagged little-B"
|
62
61
|
And the program output should not include "Feature Flagged little-WIP"
|
63
62
|
And the program output should include "2 scenarios"
|
64
63
|
|
65
64
|
Scenario: Filter with multiple tag match or'ed
|
66
|
-
When I
|
65
|
+
When I run the tests with "--tags b --tags wip"
|
67
66
|
Then the program output should not include "Feature Flagged little-A"
|
68
67
|
And the program output should include "Feature Flagged little-B"
|
69
68
|
And the program output should include "Feature Flagged little-WIP"
|
@@ -4,7 +4,6 @@ Feature: Include by tags
|
|
4
4
|
I want to include some steps only to scenarios with a specific tags
|
5
5
|
|
6
6
|
Background:
|
7
|
-
Given I am in a project using gurke
|
8
7
|
And a file "features/test_a.feature" with the following content exists
|
9
8
|
"""
|
10
9
|
@step1a
|
@@ -59,7 +58,7 @@ Feature: Include by tags
|
|
59
58
|
"""
|
60
59
|
|
61
60
|
Scenario: It should include the matching step definitions
|
62
|
-
When I
|
61
|
+
When I run the tests
|
63
62
|
Then the program output should include "DO STEP 1A"
|
64
63
|
Then the program output should include "DO STEP 2A"
|
65
64
|
Then the program output should include "DO STEP 1B"
|
@@ -4,7 +4,6 @@ Feature: Other Reporter
|
|
4
4
|
I want to pass a command line argument to change the reporter
|
5
5
|
|
6
6
|
Background:
|
7
|
-
Given I am in a project using gurke
|
8
7
|
And a file "features/test.feature" with the following content exists
|
9
8
|
"""
|
10
9
|
Feature: F
|
@@ -21,15 +20,15 @@ Feature: Other Reporter
|
|
21
20
|
"""
|
22
21
|
|
23
22
|
Scenario: Use the default reporter without addition arguments
|
24
|
-
When I
|
23
|
+
When I run the tests
|
25
24
|
Then the program output should not include "##teamcity"
|
26
25
|
|
27
26
|
Scenario: Use specified reporter when run with --formatter
|
28
|
-
When I
|
27
|
+
When I run the tests with "--formatter team_city"
|
29
28
|
Then the program output should include "##teamcity[testStarted name='Scenario A']"
|
30
29
|
Then the program output should include "##teamcity[testFinished name='Scenario A']"
|
31
30
|
|
32
31
|
Scenario: Use specified reporter when run with -f
|
33
|
-
When I
|
32
|
+
When I run the tests with "-f team_city"
|
34
33
|
Then the program output should include "##teamcity[testStarted name='Scenario A']"
|
35
34
|
Then the program output should include "##teamcity[testFinished name='Scenario A']"
|
@@ -1,8 +1,5 @@
|
|
1
1
|
Feature: Pending Steps
|
2
2
|
|
3
|
-
Background:
|
4
|
-
Given I am in a project using gurke
|
5
|
-
|
6
3
|
Scenario: Use same step definition with different keyword
|
7
4
|
Given a file "features/test.feature" with the following content exists
|
8
5
|
"""
|
@@ -11,6 +8,6 @@ Feature: Pending Steps
|
|
11
8
|
Given I am "John"
|
12
9
|
|
13
10
|
"""
|
14
|
-
When I
|
11
|
+
When I run the tests
|
15
12
|
Then the program exit code should be null
|
16
13
|
And the program output should include "1 pending"
|
@@ -4,7 +4,6 @@ Feature: Run specific features or scenarios
|
|
4
4
|
I want run only feature files from one directory
|
5
5
|
|
6
6
|
Background:
|
7
|
-
Given I am in a project using gurke
|
8
7
|
Given a file "features/odd/a.feature" with the following content exists
|
9
8
|
"""
|
10
9
|
Feature: F
|
@@ -46,17 +45,17 @@ Feature: Run specific features or scenarios
|
|
46
45
|
"""
|
47
46
|
|
48
47
|
Scenario: Run all features from on directory
|
49
|
-
When I
|
48
|
+
When I run the tests with "features/odd"
|
50
49
|
And the program output should include "2 scenarios: 0 failing, 0 pending"
|
51
50
|
|
52
51
|
Scenario: Run all features from on directory (II)
|
53
|
-
When I
|
52
|
+
When I run the tests with "features/even"
|
54
53
|
And the program output should include "1 scenarios: 0 failing, 0 pending"
|
55
54
|
|
56
55
|
Scenario: Run all features from on directory (with subdirectories)
|
57
|
-
When I
|
56
|
+
When I run the tests with "features"
|
58
57
|
And the program output should include "3 scenarios: 0 failing, 0 pending"
|
59
58
|
|
60
59
|
Scenario: Run all features from on directory (based on feature pattern)
|
61
|
-
When I
|
60
|
+
When I run the tests with "trash"
|
62
61
|
And the program output should include "0 scenarios: 0 failing, 0 pending"
|
@@ -4,7 +4,6 @@ Feature: Run specific features or scenarios
|
|
4
4
|
I want run only a specific set of files or lines
|
5
5
|
|
6
6
|
Background:
|
7
|
-
Given I am in a project using gurke
|
8
7
|
Given a file "features/a.feature" with the following content exists
|
9
8
|
"""
|
10
9
|
Feature: F
|
@@ -67,26 +66,26 @@ Feature: Run specific features or scenarios
|
|
67
66
|
"""
|
68
67
|
|
69
68
|
Scenario: Run specific file (I)
|
70
|
-
When I
|
69
|
+
When I run the tests with "features/a.feature"
|
71
70
|
And the program output should include "2 scenarios: 0 failing, 0 pending"
|
72
71
|
|
73
72
|
Scenario: Run specific file (II)
|
74
|
-
When I
|
73
|
+
When I run the tests with "features/b.feature"
|
75
74
|
And the program output should include "3 scenarios: 0 failing, 0 pending"
|
76
75
|
|
77
76
|
Scenario: Run specific line of a scenario (I)
|
78
|
-
When I
|
77
|
+
When I I run the tests with "features/b.feature:7"
|
79
78
|
And the program output should include "Scenario: Scenario B1"
|
80
79
|
And the program output should include "1 scenarios: 0 failing, 0 pending"
|
81
80
|
|
82
81
|
Scenario: Run specific line of a scenario (II)
|
83
|
-
When I
|
82
|
+
When I run the tests with "features/b.feature:7:19"
|
84
83
|
And the program output should include "Scenario: Scenario B1"
|
85
84
|
And the program output should include "Scenario: Scenario B3"
|
86
85
|
And the program output should include "2 scenarios: 0 failing, 0 pending"
|
87
86
|
|
88
87
|
Scenario: Run specific line of a scenario (III)
|
89
|
-
When I
|
88
|
+
When I run the tests with "features/a.feature:11 features/b.feature:7:19"
|
90
89
|
And the program output should include "Scenario: Scenario A2"
|
91
90
|
And the program output should include "Scenario: Scenario B1"
|
92
91
|
And the program output should include "Scenario: Scenario B3"
|
@@ -3,9 +3,6 @@ Feature: Step keyword specific definitions
|
|
3
3
|
As a user
|
4
4
|
I want to define same steps with different step keywords
|
5
5
|
|
6
|
-
Background:
|
7
|
-
Given I am in a project using gurke
|
8
|
-
|
9
6
|
Scenario: Use same step definition with different keyword
|
10
7
|
Given a file "features/test.feature" with the following content exists
|
11
8
|
"""
|
@@ -37,5 +34,5 @@ Feature: Step keyword specific definitions
|
|
37
34
|
end
|
38
35
|
Gurke.world.send :include, Steps
|
39
36
|
"""
|
40
|
-
When I
|
37
|
+
When I run the tests
|
41
38
|
Then all scenarios have passed
|
@@ -1,22 +1,31 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'open3'
|
2
4
|
|
3
|
-
#
|
4
5
|
module CLISteps
|
5
|
-
def _execute(
|
6
|
+
def _execute(args = nil)
|
6
7
|
Dir.chdir(@__root) do
|
7
8
|
Bundler.with_clean_env do
|
8
|
-
|
9
|
+
cmd = ['ruby']
|
10
|
+
cmd << '-I' << Gurke.root.join('..', 'lib').realpath
|
11
|
+
cmd << '-S' << Gurke.root.join('..', 'bin', 'gurke').realpath
|
12
|
+
|
13
|
+
unless args.to_s.include?('-f ') || args.to_s.include?('--formatter ')
|
14
|
+
cmd << '-f' << 'default'
|
15
|
+
end
|
16
|
+
|
17
|
+
cmd << args.to_s
|
18
|
+
|
19
|
+
out, err, status = Open3.capture3 cmd.join ' '
|
9
20
|
|
10
21
|
@last_process = [Integer(status), out, err]
|
11
22
|
end
|
12
23
|
end
|
13
24
|
end
|
14
25
|
|
15
|
-
step(/I
|
26
|
+
step(/I run the tests with "(.*?)"/, :_execute)
|
16
27
|
|
17
|
-
step('I
|
18
|
-
_execute 'bundle exec gurke'
|
19
|
-
end
|
28
|
+
step('I run the tests', :_execute)
|
20
29
|
|
21
30
|
step(/the program exit code should be null/) do
|
22
31
|
expect(@last_process[0]).to eq 0
|
@@ -37,7 +46,7 @@ module CLISteps
|
|
37
46
|
end
|
38
47
|
|
39
48
|
step(/the program output should not include "(.*?)"/,
|
40
|
-
|
49
|
+
:_cli_not_include_content)
|
41
50
|
|
42
51
|
step(/all scenarios have passed/) do
|
43
52
|
_cli_include_content 'scenarios: 0 failing, 0 pending'
|
@@ -1,4 +1,5 @@
|
|
1
|
-
#
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
2
3
|
module FileSteps
|
3
4
|
def _write_file(path, content)
|
4
5
|
file = @__root.join(path)
|
@@ -13,14 +14,6 @@ module FileSteps
|
|
13
14
|
File.read(file)
|
14
15
|
end
|
15
16
|
|
16
|
-
step(/I am in a project using gurke/) do
|
17
|
-
_write_file 'Gemfile', <<-EOS
|
18
|
-
source 'https://rubygems.org'
|
19
|
-
gem 'gurke', path: '#{File.dirname(Gurke.root)}'
|
20
|
-
gem 'test-unit'
|
21
|
-
EOS
|
22
|
-
end
|
23
|
-
|
24
17
|
step(/a file "(.*?)" with the following content exists/) do |path, step|
|
25
18
|
_write_file(path, step.doc_string)
|
26
19
|
end
|
data/gurke.gemspec
CHANGED
@@ -1,4 +1,5 @@
|
|
1
|
-
#
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
2
3
|
lib = File.expand_path('../lib', __FILE__)
|
3
4
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
5
|
require 'gurke/version'
|
@@ -7,27 +8,27 @@ Gem::Specification.new do |spec|
|
|
7
8
|
spec.name = 'gurke'
|
8
9
|
spec.version = Gurke::VERSION
|
9
10
|
spec.authors = ['Jan Graichen']
|
10
|
-
spec.email = %w
|
11
|
+
spec.email = %w[jg@altimos.de]
|
11
12
|
spec.homepage = 'https://github.com/jgraichen/gurke'
|
12
13
|
spec.license = 'MIT'
|
13
14
|
|
14
15
|
spec.description = \
|
15
|
-
|
16
|
+
'An alternative gherkin feature runner inspired by rspec and turnip.'
|
16
17
|
spec.summary = \
|
17
|
-
|
18
|
+
'An alternative gherkin feature runner inspired by rspec and turnip.'
|
18
19
|
|
19
20
|
spec.files = Dir['**/*'].grep %r{^(
|
20
21
|
(bin/|lib/|test/|spec/|features/)|
|
21
22
|
(\w*\.gemspec|LICENSE.*|README.*|CHANGELOG.*)$
|
22
23
|
)}x
|
23
24
|
|
24
|
-
spec.executables = spec.files.grep(
|
25
|
-
spec.test_files = spec.files.grep(
|
26
|
-
spec.require_paths = %w
|
25
|
+
spec.executables = spec.files.grep(%r{^bin/}) {|f| File.basename(f) }
|
26
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
27
|
+
spec.require_paths = %w[lib]
|
27
28
|
|
28
|
-
spec.add_dependency 'trollop'
|
29
|
-
spec.add_dependency 'gherkin', '~> 2.0'
|
30
29
|
spec.add_dependency 'colorize'
|
30
|
+
spec.add_dependency 'gherkin', '~> 2.0'
|
31
|
+
spec.add_dependency 'trollop'
|
31
32
|
|
32
33
|
spec.add_development_dependency 'bundler', '~> 1.3'
|
33
34
|
|
data/lib/gurke.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'gurke/version'
|
2
4
|
require 'pathname'
|
3
5
|
|
@@ -21,6 +23,7 @@ module Gurke
|
|
21
23
|
|
22
24
|
module Reporters
|
23
25
|
require 'gurke/reporters/null_reporter'
|
26
|
+
require 'gurke/reporters/compact_reporter'
|
24
27
|
require 'gurke/reporters/default_reporter'
|
25
28
|
require 'gurke/reporters/team_city_reporter'
|
26
29
|
end
|