cucumber 2.3.2 → 2.3.3
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 +4 -4
- data/History.md +13 -2
- data/cucumber.gemspec +10 -0
- data/features/docs/cli/randomize.feature +21 -3
- data/lib/cucumber/formatter/json.rb +8 -1
- data/lib/cucumber/gherkin/steps_parser.rb +1 -3
- data/lib/cucumber/version +1 -1
- data/spec/cucumber/formatter/json_spec.rb +42 -0
- metadata +6 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c53e4902ca73f5999ff60be26b1817622c631974
|
4
|
+
data.tar.gz: b4f35193ddd03bacefefd3483184fb9f88c1f624
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 09376bab164a61f983d2bd94c58f3621b7c773378ccfd5df577dbc76349b1d26c4da2a7d95557b65c8636aee403c08291d611124d81562f9824cd8b61acdd420
|
7
|
+
data.tar.gz: 928438ab720c2b6b18ceeb2f7b13b8df82d733fcf399095a4f5b7c68f4ca1601487a8661bff4d6c36c71074464bd36ba0884c87311023ef703c2d2ab5b9ed34b
|
data/History.md
CHANGED
@@ -1,6 +1,17 @@
|
|
1
|
-
## [In Git](https://github.com/cucumber/cucumber-ruby/compare/v2.3.
|
1
|
+
## [In Git](https://github.com/cucumber/cucumber-ruby/compare/v2.3.3...master)
|
2
2
|
|
3
|
-
|
3
|
+
### New Features
|
4
|
+
|
5
|
+
### Bugfixes
|
6
|
+
|
7
|
+
## [v2.3.3](https://github.com/cucumber/cucumber-ruby/compare/v2.3.2...v2.3.3)
|
8
|
+
|
9
|
+
Added a message pointing users to [The Great Cucumber and BDD Census of 2016](https://cucumber.typeform.com/to/kjrSc2?audience=cucumber-ruby) to the installer message. Please take a few moments to help us all learn more about how you're using Cucumber and BDD.
|
10
|
+
|
11
|
+
### Bugfixes
|
12
|
+
|
13
|
+
* Let the JSON formatter include data tables in the JSON file ([#948](https://github.com/cucumber/cucumber-ruby/issues/948) @brasmusson)
|
14
|
+
* Stringifying location in the JSON formatter for more consistent json parsing ([949](https://github.com/cucumber/cucumber-ruby/pull/949), [945](https://github.com/cucumber/cucumber-ruby/issues/945) @larryprice)
|
4
15
|
|
5
16
|
## [v2.3.2](https://github.com/cucumber/cucumber-ruby/compare/v2.3.1...v2.3.2)
|
6
17
|
|
data/cucumber.gemspec
CHANGED
@@ -10,6 +10,16 @@ Gem::Specification.new do |s|
|
|
10
10
|
s.homepage = "http://cukes.info"
|
11
11
|
s.platform = Gem::Platform::RUBY
|
12
12
|
s.required_ruby_version = ">= 1.9.3"
|
13
|
+
s.post_install_message = %{We need your help.
|
14
|
+
|
15
|
+
Please take a few minutes to fill out our survey and help us understand how BDD and Cucumber are used in the wild.
|
16
|
+
|
17
|
+
http://tinyurl.com/zk9jyrf
|
18
|
+
|
19
|
+
Thanks!
|
20
|
+
|
21
|
+
♡ The Cucumber Team ♡
|
22
|
+
}
|
13
23
|
|
14
24
|
s.add_dependency 'cucumber-core', '~> 1.4.0'
|
15
25
|
s.add_dependency 'builder', '>= 2.1.2'
|
@@ -5,7 +5,7 @@ Feature: Randomize
|
|
5
5
|
This is especially helpful for detecting situations where you have state
|
6
6
|
leaking between scenarios, which can cause flickering or fragile tests.
|
7
7
|
|
8
|
-
If you do find a
|
8
|
+
If you do find a random run that exposes dependencies between your tests,
|
9
9
|
you can reproduce that run by using the seed that's printed at the end of
|
10
10
|
the test run.
|
11
11
|
|
@@ -37,10 +37,28 @@ Feature: Randomize
|
|
37
37
|
|
38
38
|
@spawn
|
39
39
|
Scenario: Run scenarios randomized
|
40
|
-
When I run `cucumber --order random:41515`
|
40
|
+
When I run `cucumber --order random:41515 -q`
|
41
41
|
Then it should fail
|
42
|
-
And the stdout should contain:
|
42
|
+
And the stdout should contain exactly:
|
43
43
|
"""
|
44
|
+
Feature: Bad practice
|
45
|
+
|
46
|
+
Scenario: Depend on state
|
47
|
+
When I depend on the state
|
48
|
+
I expect the state to be set! (RuntimeError)
|
49
|
+
./features/step_definitions/steps.rb:6:in `/^I depend on the state$/'
|
50
|
+
features/bad_practice.feature:7:in `When I depend on the state'
|
51
|
+
|
52
|
+
Scenario: Set state
|
53
|
+
Given I set some state
|
54
|
+
|
55
|
+
Failing Scenarios:
|
56
|
+
cucumber features/bad_practice.feature:6
|
57
|
+
|
58
|
+
2 scenarios (1 failed, 1 passed)
|
59
|
+
2 steps (1 failed, 1 passed)
|
60
|
+
|
44
61
|
Randomized with seed 41515
|
62
|
+
|
45
63
|
"""
|
46
64
|
|
@@ -153,6 +153,7 @@ module Cucumber
|
|
153
153
|
}
|
154
154
|
step_hash[:comments] = Formatter.create_comments_array(step_source.comments) unless step_source.comments.empty?
|
155
155
|
step_hash[:doc_string] = create_doc_string_hash(step_source.multiline_arg) if step_source.multiline_arg.doc_string?
|
156
|
+
step_hash[:rows] = create_data_table_value(step_source.multiline_arg) if step_source.multiline_arg.data_table?
|
156
157
|
step_hash
|
157
158
|
end
|
158
159
|
|
@@ -165,6 +166,12 @@ module Cucumber
|
|
165
166
|
}
|
166
167
|
end
|
167
168
|
|
169
|
+
def create_data_table_value(data_table)
|
170
|
+
data_table.raw.map do |row|
|
171
|
+
{ cells: row }
|
172
|
+
end
|
173
|
+
end
|
174
|
+
|
168
175
|
def add_match_and_result(test_step, result)
|
169
176
|
@step_or_hook_hash[:match] = create_match_hash(test_step, result)
|
170
177
|
@step_or_hook_hash[:result] = create_result_hash(result)
|
@@ -179,7 +186,7 @@ module Cucumber
|
|
179
186
|
end
|
180
187
|
|
181
188
|
def create_match_hash(test_step, result)
|
182
|
-
{ location: test_step.action_location }
|
189
|
+
{ location: test_step.action_location.to_s }
|
183
190
|
end
|
184
191
|
|
185
192
|
def create_result_hash(result)
|
@@ -12,11 +12,9 @@ module Cucumber
|
|
12
12
|
end
|
13
13
|
def parse(text)
|
14
14
|
ast_builder = ::Gherkin::AstBuilder.new
|
15
|
-
token_matcher = ::Gherkin::TokenMatcher.new
|
16
|
-
token_matcher.send(:change_dialect, @language, nil) unless @language == 'en'
|
17
15
|
context = ::Gherkin::ParserContext.new(
|
18
16
|
::Gherkin::TokenScanner.new(text),
|
19
|
-
|
17
|
+
::Gherkin::TokenMatcher.new(@language),
|
20
18
|
[],
|
21
19
|
[]
|
22
20
|
)
|
data/lib/cucumber/version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.3.
|
1
|
+
2.3.3
|
@@ -757,6 +757,48 @@ module Cucumber
|
|
757
757
|
"duration": 1}}]}]}]})
|
758
758
|
end
|
759
759
|
end
|
760
|
+
|
761
|
+
describe "with a scenario with a step with a data table" do
|
762
|
+
define_feature <<-FEATURE
|
763
|
+
Feature: Banana party
|
764
|
+
|
765
|
+
Scenario: Monkey eats bananas
|
766
|
+
Given there are bananas
|
767
|
+
| aa | bb |
|
768
|
+
| cc | dd |
|
769
|
+
FEATURE
|
770
|
+
|
771
|
+
define_steps do
|
772
|
+
Given(/^there are bananas$/) { |s| s }
|
773
|
+
end
|
774
|
+
|
775
|
+
it "includes the doc string in the json data" do
|
776
|
+
expect(load_normalised_json(@out)).to eq MultiJson.load(%{
|
777
|
+
[{"id": "banana-party",
|
778
|
+
"uri": "spec.feature",
|
779
|
+
"keyword": "Feature",
|
780
|
+
"name": "Banana party",
|
781
|
+
"line": 1,
|
782
|
+
"description": "",
|
783
|
+
"elements":
|
784
|
+
[{"id": "banana-party;monkey-eats-bananas",
|
785
|
+
"keyword": "Scenario",
|
786
|
+
"name": "Monkey eats bananas",
|
787
|
+
"line": 3,
|
788
|
+
"description": "",
|
789
|
+
"type": "scenario",
|
790
|
+
"steps":
|
791
|
+
[{"keyword": "Given ",
|
792
|
+
"name": "there are bananas",
|
793
|
+
"line": 4,
|
794
|
+
"rows":
|
795
|
+
[{"cells": ["aa", "bb"]},
|
796
|
+
{"cells": ["cc", "dd"]}],
|
797
|
+
"match": {"location": "spec/cucumber/formatter/json_spec.rb:772"},
|
798
|
+
"result": {"status": "passed",
|
799
|
+
"duration": 1}}]}]}]})
|
800
|
+
end
|
801
|
+
end
|
760
802
|
end
|
761
803
|
|
762
804
|
def load_normalised_json(out)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cucumber
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.3.
|
4
|
+
version: 2.3.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Aslak Hellesøy
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2016-
|
13
|
+
date: 2016-03-18 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: cucumber-core
|
@@ -832,7 +832,9 @@ homepage: http://cukes.info
|
|
832
832
|
licenses:
|
833
833
|
- MIT
|
834
834
|
metadata: {}
|
835
|
-
post_install_message:
|
835
|
+
post_install_message: "We need your help.\n \nPlease take a few minutes to fill
|
836
|
+
out our survey and help us understand how BDD and Cucumber are used in the wild.\n
|
837
|
+
\ \n http://tinyurl.com/zk9jyrf\n\nThanks!\n\n♡ The Cucumber Team ♡\n"
|
836
838
|
rdoc_options:
|
837
839
|
- "--charset=UTF-8"
|
838
840
|
require_paths:
|
@@ -852,7 +854,7 @@ rubyforge_project:
|
|
852
854
|
rubygems_version: 2.2.2
|
853
855
|
signing_key:
|
854
856
|
specification_version: 4
|
855
|
-
summary: cucumber-2.3.
|
857
|
+
summary: cucumber-2.3.3
|
856
858
|
test_files:
|
857
859
|
- features/docs/api/list_step_defs_as_json.feature
|
858
860
|
- features/docs/api/listen_for_events.feature
|