macros4cuke 0.5.06 → 0.5.07
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 +8 -8
- data/.rubocop.yml +6 -1
- data/CHANGELOG.md +4 -0
- data/Gemfile +1 -1
- data/features/2_macros_with_arguments/demo03.feature +21 -0
- data/features/support/{use_macros4cuke.rb → macro_support.rb} +2 -2
- data/lib/macros4cuke/constants.rb +1 -1
- data/lib/macros4cuke/formatting-service.rb +1 -1
- data/spec/macros4cuke/formatting-service_spec.rb +2 -1
- data/spec/macros4cuke/templating/engine_spec.rb +1 -1
- metadata +3 -4
- data/features/support/my_formatter.rb +0 -25
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
NzQxMzNkYWU3ZTRhOGQ1M2MzZWRhMGVkZGFhNTgxODI1MjE2NWY3ZA==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
NGM1ZmJjZTdiZGM0YWRiOTNjODIxZmUzMDZjODE0ODBiZWJhNjBiMA==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
MWViOTM2OGI3ODcwYWRlN2M0YWQ1Mzg5MmViMGIwNTEzYjI4YTdlZTk1M2Qy
|
10
|
+
ZTA5MmYxZTIxYjAwMzY4OGY4OGRiYjY2MDhjMTZlODczZGJkMmZmMTA1MGQw
|
11
|
+
ZDkxM2IwMmU3NzQyN2U3OWVlNGViYmJjYWM2YTgwODA1NzY5NjQ=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
ZTgwM2M4OWM3MTQyMzA4ODljNTA0YzFjNjRmNWUyZDc1MzczMDI3NzA0NDA0
|
14
|
+
MWVlNDQ0MTA0NWI5MzI4NzBhYzdkYWFiMjcyMmRkY2FmZTYxZmNjYjM2Nzk4
|
15
|
+
ODUzZmMwOWVjYTMxZjI3OGY0NWIxNDEzZmMzZDQ5NDA5OWIxZTA=
|
data/.rubocop.yml
CHANGED
@@ -12,8 +12,13 @@ CaseIndentation:
|
|
12
12
|
IndentWhenRelativeTo: end
|
13
13
|
IndentOneStep: true
|
14
14
|
|
15
|
+
# Rubocop enforces the use of is_a? instead of kind_of?
|
16
|
+
# Which is contrary to modelling practice.
|
17
|
+
ClassCheck:
|
18
|
+
Enabled: false
|
19
|
+
|
15
20
|
ClassLength:
|
16
|
-
Max:
|
21
|
+
Max: 250
|
17
22
|
CountComments: false
|
18
23
|
|
19
24
|
ConstantName:
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,7 @@
|
|
1
|
+
### 0.5.06 / 2014-06-30
|
2
|
+
* [CHANGE] Multiple minor changes to please Rubocop 0.26.1
|
3
|
+
* [CHANGE] File `demo03.feature`: Added an example with scenario outline
|
4
|
+
|
1
5
|
### 0.5.06 / 2014-06-30
|
2
6
|
* [CHANGE] Spec files upgraded to RSpec3.x.x
|
3
7
|
* [CHANGE] File `Gemfile` updated with dependency on RSpec3
|
data/Gemfile
CHANGED
@@ -32,4 +32,25 @@ Scenario: Using the macro with multiple arguments
|
|
32
32
|
And I fill in "Password" with "cosmic"
|
33
33
|
And I click "Submit"
|
34
34
|
"""
|
35
|
+
|
36
|
+
Scenario Outline: Using the macro in a scenario outline with argument values from example rows
|
37
|
+
# Macros work smoothly in scenario outlines.
|
38
|
+
# Their argument values can even be initialized from the example rows
|
39
|
+
# Here the macro is invoked. It argument values <user_id>, <pwd> comes from example rows below.
|
40
|
+
When I [enter my userid "<user_id>" and password "<pwd>"]
|
35
41
|
|
42
|
+
# The next step verifies that the steps from the macro were effectively executed.
|
43
|
+
Then I expect the following step trace:
|
44
|
+
"""
|
45
|
+
Given I landed in the homepage
|
46
|
+
When I click "Sign in"
|
47
|
+
And I fill in "Username" with "<user_id>"
|
48
|
+
And I fill in "Password" with "<pwd>"
|
49
|
+
And I click "Submit"
|
50
|
+
"""
|
51
|
+
Then I click "Sign out"
|
52
|
+
|
53
|
+
Examples:
|
54
|
+
|user_id | pwd |
|
55
|
+
|james007|goldeneye|
|
56
|
+
|ann |oneemous |
|
@@ -1,10 +1,10 @@
|
|
1
|
-
# File:
|
1
|
+
# File: macro_support.rb
|
2
2
|
# Purpose: Add the support for macros in a Cucumber project.
|
3
3
|
# This file is meant to be put next to the 'env.rb' file
|
4
4
|
# of your Cucumber project.
|
5
5
|
|
6
6
|
|
7
|
-
# Load modules
|
7
|
+
# Load modules and classes from the gem and also its step definitions
|
8
8
|
require 'macros4cuke/cucumber'
|
9
9
|
|
10
10
|
|
@@ -61,7 +61,7 @@ class FormattingService
|
|
61
61
|
next unless accepted_notifications.include? msg
|
62
62
|
|
63
63
|
# Assumption: all nil argument(s) are at the end
|
64
|
-
arg_vector = visit_event[2..-1].reject
|
64
|
+
arg_vector = visit_event[2..-1].reject(&:nil?)
|
65
65
|
fmt.send(msg, nesting_level, *arg_vector)
|
66
66
|
end
|
67
67
|
end
|
@@ -43,7 +43,8 @@ describe FormattingService do
|
|
43
43
|
context 'Provided services:' do
|
44
44
|
it 'should know its registered formatter(s)' do
|
45
45
|
formatter1 = double('fake_one')
|
46
|
-
|
46
|
+
events = [:on_collection]
|
47
|
+
expect(formatter1).to receive(:implements).once.and_return(events)
|
47
48
|
subject.register(formatter1)
|
48
49
|
expect(subject.formatters.size).to eq(1)
|
49
50
|
|
@@ -202,7 +202,7 @@ SNIPPET
|
|
202
202
|
instance = Engine.new sophisticated_template
|
203
203
|
elements = instance.instance_variable_get(:@representation)
|
204
204
|
sections = elements.select { |e| e.is_a?(Section) }
|
205
|
-
names = sections.map
|
205
|
+
names = sections.map(&:to_s)
|
206
206
|
expect(names).to eq(%w(<?address> <?birthdate> <?dummy>))
|
207
207
|
end
|
208
208
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: macros4cuke
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.07
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dimitri Geshef
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-10-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: cucumber
|
@@ -156,8 +156,7 @@ files:
|
|
156
156
|
- features/README.md
|
157
157
|
- features/step_definitions/demo_steps.rb
|
158
158
|
- features/support/env.rb
|
159
|
-
- features/support/
|
160
|
-
- features/support/use_macros4cuke.rb
|
159
|
+
- features/support/macro_support.rb
|
161
160
|
- spec/macros4cuke/application_spec.rb
|
162
161
|
- spec/macros4cuke/cli/cmd-line_spec.rb
|
163
162
|
- spec/macros4cuke/coll-walker-factory_spec.rb
|
@@ -1,25 +0,0 @@
|
|
1
|
-
module Macros4Cuke # Module used as a namespace
|
2
|
-
|
3
|
-
require 'pp'
|
4
|
-
|
5
|
-
class MyFormatter
|
6
|
-
attr_reader(:ostream)
|
7
|
-
|
8
|
-
def initialize(_, io, _)
|
9
|
-
@ostream = io
|
10
|
-
end
|
11
|
-
|
12
|
-
|
13
|
-
def step_name(_, step_match, _, _, _, _)
|
14
|
-
pp step_match
|
15
|
-
pp step_match.instance_variables
|
16
|
-
|
17
|
-
# Returns a Cucumber::RbSupport::RbStepDefinition
|
18
|
-
pp step_match.instance_variable_get(:@step_definition).class
|
19
|
-
pp step_match.instance_variable_get(:@step_definition).object_id
|
20
|
-
pp step_match.instance_variable_get(:@name_to_match)
|
21
|
-
pp step_match.instance_variable_get(:@step_arguments)
|
22
|
-
end
|
23
|
-
end # class
|
24
|
-
|
25
|
-
end # module
|