rspec-with_params 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.circleci/config.yml +63 -0
- data/CHANGELOG.md +11 -0
- data/Gemfile +2 -0
- data/Gemfile.lock +2 -1
- data/README.md +15 -5
- data/Rakefile +2 -0
- data/lib/rspec/with_params.rb +2 -0
- data/lib/rspec/with_params/dsl.rb +2 -0
- data/lib/rspec/with_params/version.rb +3 -1
- data/rspec-with_params.gemspec +5 -0
- metadata +20 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7efe33799e8609c3ee3cac2ef1c18ab3edacb9a4f9ad10b5a4ae480c6e556eea
|
4
|
+
data.tar.gz: 102f61c2101ddb65c755858c0f71b008f114c1a625dc0c701555efb5683e9bed
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a72958b7385424937fb148472cfc591268edd74f6e7324d74bd454e86e58d478c587cc1e6d80f94a09d1f063a9ccb8a2465f5f1c5c57b6e0f521383a902ff9ed
|
7
|
+
data.tar.gz: 42bfffdb836abb500fed9c79d45597483c716749a2a77c70d103c7fbaa722f1b10b2aa58e355ed8183e9f959baed0d951479e8e5491e321be43e76b333603528
|
@@ -0,0 +1,63 @@
|
|
1
|
+
---
|
2
|
+
version: 2
|
3
|
+
|
4
|
+
#-------------------------------------------------------------------------------
|
5
|
+
|
6
|
+
base_job: &base_job
|
7
|
+
working_directory: ~/repo
|
8
|
+
steps:
|
9
|
+
- checkout
|
10
|
+
|
11
|
+
- restore_cache:
|
12
|
+
keys:
|
13
|
+
- v1-dependencies-{{ checksum "Gemfile.lock" }}
|
14
|
+
# fallback to using the latest cache if no exact match is found
|
15
|
+
- v1-dependencies-
|
16
|
+
|
17
|
+
- run:
|
18
|
+
name: install dependencies
|
19
|
+
command: bundle install --jobs=4 --retry=3 --path vendor/bundle
|
20
|
+
|
21
|
+
- save_cache:
|
22
|
+
paths:
|
23
|
+
- ./vendor/bundle
|
24
|
+
key: v1-dependencies-{{ checksum "Gemfile.lock" }}
|
25
|
+
|
26
|
+
- run:
|
27
|
+
name: run tests
|
28
|
+
command: |
|
29
|
+
bundle exec rspec --format progress \
|
30
|
+
--format RspecJunitFormatter \
|
31
|
+
--out test-results/rspec.xml
|
32
|
+
|
33
|
+
# collect reports
|
34
|
+
- store_test_results:
|
35
|
+
path: test-results
|
36
|
+
|
37
|
+
#-------------------------------------------------------------------------------
|
38
|
+
|
39
|
+
jobs:
|
40
|
+
ruby-2.4:
|
41
|
+
<<: *base_job
|
42
|
+
docker:
|
43
|
+
- image: circleci/ruby:2.4
|
44
|
+
ruby-2.5:
|
45
|
+
<<: *base_job
|
46
|
+
docker:
|
47
|
+
- image: circleci/ruby:2.5
|
48
|
+
ruby-2.6:
|
49
|
+
<<: *base_job
|
50
|
+
docker:
|
51
|
+
- image: circleci/ruby:2.6
|
52
|
+
environment:
|
53
|
+
ENABLE_COVERAGE: 1
|
54
|
+
|
55
|
+
#-------------------------------------------------------------------------------
|
56
|
+
|
57
|
+
workflows:
|
58
|
+
version: 2
|
59
|
+
multiple-rubies:
|
60
|
+
jobs:
|
61
|
+
- ruby-2.4
|
62
|
+
- ruby-2.5
|
63
|
+
- ruby-2.6
|
data/CHANGELOG.md
ADDED
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -1,7 +1,8 @@
|
|
1
|
-
#
|
1
|
+
# RSpec::WithParams
|
2
2
|
|
3
|
-
|
4
|
-
|
3
|
+
[![Gem Version](https://badge.fury.io/rb/rspec-with_params.svg)](https://rubygems.org/gems/rspec-with_params) [![CircleCI](https://circleci.com/gh/odlp/rspec-with_params.svg?style=shield)](https://circleci.com/gh/odlp/rspec-with_params)
|
4
|
+
|
5
|
+
Simple parameterized testing (a.k.a table tests) with RSpec.
|
5
6
|
|
6
7
|
```ruby
|
7
8
|
RSpec.describe "my complex business logic" do
|
@@ -11,7 +12,7 @@ RSpec.describe "my complex business logic" do
|
|
11
12
|
[:today, :schedule, :expected_date],
|
12
13
|
["2019-06-05", "weekly", "2019-06-13"],
|
13
14
|
["2019-06-05", "bi-weekly", "2019-06-20"],
|
14
|
-
["2019-06-05", "monthly", "2019-
|
15
|
+
["2019-06-05", "monthly", "2019-07-13"],
|
15
16
|
) do
|
16
17
|
it "determines the next appointment date" do
|
17
18
|
result = NextAppointmentCalculator.new.process(today, schedule)
|
@@ -68,9 +69,18 @@ RSpec.configure do |config|
|
|
68
69
|
end
|
69
70
|
```
|
70
71
|
|
72
|
+
## Development
|
73
|
+
|
74
|
+
```
|
75
|
+
git clone git@github.com:odlp/rspec-with_params.git
|
76
|
+
cd rspec-with_params
|
77
|
+
bundle
|
78
|
+
bundle exec rake
|
79
|
+
```
|
80
|
+
|
71
81
|
## Alternatives
|
72
82
|
|
73
|
-
- [`rspec-parameterized`][rspec-parameterized] - A more-complex
|
83
|
+
- [`rspec-parameterized`][rspec-parameterized] - A slicker (more-complex?) DSL.
|
74
84
|
Inspiration for this library.
|
75
85
|
|
76
86
|
[rspec-parameterized]: https://github.com/tomykaira/rspec-parameterized
|
data/Rakefile
CHANGED
data/lib/rspec/with_params.rb
CHANGED
data/rspec-with_params.gemspec
CHANGED
@@ -20,8 +20,13 @@ Gem::Specification.new do |spec|
|
|
20
20
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
21
21
|
spec.require_paths = ["lib"]
|
22
22
|
|
23
|
+
spec.required_ruby_version = "~> 2.4"
|
24
|
+
|
25
|
+
spec.add_dependency "rspec", "~> 3.0"
|
26
|
+
|
23
27
|
spec.add_development_dependency "bundler", "~> 1.17"
|
24
28
|
spec.add_development_dependency "rake", "~> 10.0"
|
25
29
|
spec.add_development_dependency "rspec", "~> 3.8"
|
26
30
|
spec.add_development_dependency "jet_black", "~> 0.5"
|
31
|
+
spec.add_development_dependency "rspec_junit_formatter" if ENV.key?("CI")
|
27
32
|
end
|
metadata
CHANGED
@@ -1,15 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rspec-with_params
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Oliver Peate
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-05
|
11
|
+
date: 2019-06-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: rspec
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '3.0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '3.0'
|
13
27
|
- !ruby/object:Gem::Dependency
|
14
28
|
name: bundler
|
15
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -72,9 +86,11 @@ executables: []
|
|
72
86
|
extensions: []
|
73
87
|
extra_rdoc_files: []
|
74
88
|
files:
|
89
|
+
- ".circleci/config.yml"
|
75
90
|
- ".gitignore"
|
76
91
|
- ".rspec"
|
77
92
|
- ".travis.yml"
|
93
|
+
- CHANGELOG.md
|
78
94
|
- Gemfile
|
79
95
|
- Gemfile.lock
|
80
96
|
- LICENSE.txt
|
@@ -96,9 +112,9 @@ require_paths:
|
|
96
112
|
- lib
|
97
113
|
required_ruby_version: !ruby/object:Gem::Requirement
|
98
114
|
requirements:
|
99
|
-
- - "
|
115
|
+
- - "~>"
|
100
116
|
- !ruby/object:Gem::Version
|
101
|
-
version: '
|
117
|
+
version: '2.4'
|
102
118
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
103
119
|
requirements:
|
104
120
|
- - ">="
|