cucumber_factory 1.15.0 → 1.15.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +23 -0
- data/README.md +2 -2
- data/lib/cucumber_factory/factory.rb +4 -2
- data/lib/cucumber_factory/version.rb +1 -1
- data/spec/cucumber_factory/steps_spec.rb +18 -0
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dea4a8b653f917a949a4948dc68ca3f30afe967714c1a3296e08e17c18d8640f
|
4
|
+
data.tar.gz: 0bfcb630869f9a610a8123c2c8160df90dd940c8bbc8d65b1cdc88269d765f05
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 56201d23d93dd5325c94b8c36cf79c0aa735613a2f998e3efce3b3c9136c90df423195449899cc5ff549af528fa67e92c07587e2c3cceffb7ce1a8067d971153
|
7
|
+
data.tar.gz: f251f17f0edc4c7ce9f96184c72b515920ca15a44fd3b38ed5509072b718a00663bd7c871edfd7caef643a626df4f56eaaf84839c879c5f767e3452368b37223
|
data/CHANGELOG.md
CHANGED
@@ -5,6 +5,29 @@ All notable changes to this project will be documented in this file.
|
|
5
5
|
This project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
|
6
6
|
|
7
7
|
|
8
|
+
## Unreleased
|
9
|
+
|
10
|
+
### Breaking changes
|
11
|
+
|
12
|
+
-
|
13
|
+
|
14
|
+
### Compatible changes
|
15
|
+
|
16
|
+
-
|
17
|
+
|
18
|
+
## 1.15.1 - 2019-05-30
|
19
|
+
|
20
|
+
### Compatible changes
|
21
|
+
|
22
|
+
- Fix: Allow to use array assignments within a doc string or table assignment
|
23
|
+
|
24
|
+
Example:
|
25
|
+
|
26
|
+
```
|
27
|
+
Given there is a post with these attributes:
|
28
|
+
|tags| ["urgent", "vip"] |
|
29
|
+
```
|
30
|
+
|
8
31
|
## 1.15.0 - 2019-02-08
|
9
32
|
|
10
33
|
### Breaking changes
|
data/README.md
CHANGED
@@ -190,11 +190,11 @@ Development
|
|
190
190
|
|
191
191
|
There are tests in `spec`. We only accept PRs with tests. To run tests:
|
192
192
|
|
193
|
-
- Install Ruby 2.5.
|
193
|
+
- Install Ruby 2.5.3
|
194
194
|
- Create a local MySQL database `cucumber_factory_test`
|
195
195
|
- Copy `spec/support/database.sample.yml` to `spec/support/database.yml` and enter your local credentials for the test databases
|
196
196
|
- Install development dependencies using `bundle install`
|
197
|
-
- Run tests with the default symlinked Gemfile using `bundle exec rspec` or explicit with `BUNDLE_GEMFILE=
|
197
|
+
- Run tests with the default symlinked Gemfile using `bundle exec rspec` or explicit with `BUNDLE_GEMFILE=Gemfile.cucumber-x.x bundle exec rspec spec`
|
198
198
|
|
199
199
|
We recommend to test large changes against multiple versions of Ruby and multiple dependency sets. Supported combinations are configured in `.travis.yml`. We provide some rake tasks to help with this:
|
200
200
|
|
@@ -122,13 +122,15 @@ module CucumberFactory
|
|
122
122
|
raw_multiline_attributes.split("\n").each do |fragment|
|
123
123
|
raw_attribute, value = fragment.split(': ')
|
124
124
|
attribute = attribute_name_from_prose(raw_attribute)
|
125
|
-
|
125
|
+
value = "\"#{value}\"" unless matches_fully?(value, VALUE_ARRAY)
|
126
|
+
attributes[attribute] = attribute_value(world, model_class, attribute, value)
|
126
127
|
end
|
127
128
|
# DataTable e.g. in raw [["first name", "Jane"], ["last name", "Jenny"]]
|
128
129
|
else
|
129
130
|
raw_multiline_attributes.raw.each do |raw_attribute, value|
|
130
131
|
attribute = attribute_name_from_prose(raw_attribute)
|
131
|
-
|
132
|
+
value = "\"#{value}\"" unless matches_fully?(value, VALUE_ARRAY)
|
133
|
+
attributes[attribute] = attribute_value(world, model_class, attribute, value)
|
132
134
|
end
|
133
135
|
end
|
134
136
|
end
|
@@ -391,6 +391,15 @@ name: Jane
|
|
391
391
|
user.email.should == "test@invalid.com"
|
392
392
|
end
|
393
393
|
|
394
|
+
it "should allow to set array attributes via doc string" do
|
395
|
+
invoke_cucumber_step('there is a plain Ruby class with these attributes:', <<-DOC_STRING)
|
396
|
+
tags: ["foo", "bar"]
|
397
|
+
DOC_STRING
|
398
|
+
|
399
|
+
obj = PlainRubyClass.last
|
400
|
+
obj.attributes[:tags].should == ['foo', 'bar']
|
401
|
+
end
|
402
|
+
|
394
403
|
it "should allow to set attributes via data table" do
|
395
404
|
user = User.new
|
396
405
|
User.stub(:new => user)
|
@@ -416,4 +425,13 @@ name: Jane
|
|
416
425
|
user.email.should == "test@invalid.com"
|
417
426
|
end
|
418
427
|
|
428
|
+
it "should allow to set array attributes via data table" do
|
429
|
+
invoke_cucumber_step('there is a plain Ruby class with these attributes:', nil, <<-DATA_TABLE)
|
430
|
+
| tags | ["foo", "bar"] |
|
431
|
+
DATA_TABLE
|
432
|
+
|
433
|
+
obj = PlainRubyClass.last
|
434
|
+
obj.attributes[:tags].should == ['foo', 'bar']
|
435
|
+
end
|
436
|
+
|
419
437
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cucumber_factory
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.15.
|
4
|
+
version: 1.15.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Henning Koch
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-05-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: cucumber
|
@@ -134,8 +134,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
134
134
|
- !ruby/object:Gem::Version
|
135
135
|
version: '0'
|
136
136
|
requirements: []
|
137
|
-
|
138
|
-
rubygems_version: 2.7.6
|
137
|
+
rubygems_version: 3.0.3
|
139
138
|
signing_key:
|
140
139
|
specification_version: 4
|
141
140
|
summary: Create records from Cucumber features without writing step definitions.
|