rspec-parameterized 0.5.1 → 0.5.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/rspec.yml +1 -1
- data/CHANGELOG.md +16 -1
- data/lib/rspec/parameterized/table_syntax.rb +39 -25
- data/lib/rspec/parameterized/version.rb +1 -1
- data/lib/rspec/parameterized.rb +5 -5
- data/rspec-parameterized.gemspec +3 -1
- metadata +8 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '0394579cf5005becd6e7b94186ea47ba37aee0440ea354483b4d2fde7acc2a24'
|
4
|
+
data.tar.gz: 7f0bcb5613a91aba4c460dea82ad59c603563c83f87e6b907816fbaa202b2934
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 744d46bd1d4180c2fc884681e95c84314593af287278a61eeeb0d3ceb1d4400a1d2322c35ae3bbcc74a5fc650e65c4d4e87c5fda0e03b6e87c7af63ab292adb8
|
7
|
+
data.tar.gz: f71bbf3fb4f4e7e35a6ab23e1d2be5f266abec76f3279af6dc5aeb75ac5bbc66c9ddd9368a7978bee54a099595cca26ac8bac29eda8cc5268492dac8115b79ae
|
data/.github/workflows/rspec.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,6 +1,21 @@
|
|
1
1
|
# Change Log
|
2
2
|
## Unreleased
|
3
|
-
[Full Changelog](https://github.com/tomykaira/rspec-parameterized/compare/v0.5.
|
3
|
+
[Full Changelog](https://github.com/tomykaira/rspec-parameterized/compare/v0.5.3...master)
|
4
|
+
|
5
|
+
## [v0.5.3](https://github.com/tomykaira/rspec-parameterized/tree/v0.5.3) (2022-12-29)
|
6
|
+
[Full Changelog](https://github.com/tomykaira/rspec-parameterized/compare/v0.5.2...v0.5.3)
|
7
|
+
|
8
|
+
- Fix uninitialized instance variable warning
|
9
|
+
- https://github.com/tomykaira/rspec-parameterized/pull/78
|
10
|
+
- Support Ruby 3.2
|
11
|
+
- https://github.com/tomykaira/rspec-parameterized/pull/81
|
12
|
+
- https://github.com/tomykaira/rspec-parameterized/issues/80
|
13
|
+
|
14
|
+
## [v0.5.2](https://github.com/tomykaira/rspec-parameterized/tree/v0.5.2) (2022-06-24)
|
15
|
+
[Full Changelog](https://github.com/tomykaira/rspec-parameterized/compare/v0.5.1...v0.5.2)
|
16
|
+
|
17
|
+
- Made MFA mandatory for gem releases
|
18
|
+
- https://github.com/tomykaira/rspec-parameterized/pull/79
|
4
19
|
|
5
20
|
## [v0.5.1](https://github.com/tomykaira/rspec-parameterized/tree/v0.5.1) (2022-01-04)
|
6
21
|
[Full Changelog](https://github.com/tomykaira/rspec-parameterized/compare/v0.5.0...v0.5.1)
|
@@ -1,13 +1,12 @@
|
|
1
1
|
require 'rspec/parameterized/table'
|
2
|
-
require '
|
2
|
+
require 'binding_of_caller'
|
3
3
|
|
4
4
|
module RSpec
|
5
5
|
module Parameterized
|
6
6
|
module TableSyntaxImplement
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
caller_instance = where_binding.receiver # get caller instance (ExampleGroup)
|
7
|
+
def |(other)
|
8
|
+
where_binding = binding.of_caller(1) # get where block binding
|
9
|
+
caller_instance = eval("self", where_binding) # get caller instance (ExampleGroup)
|
11
10
|
|
12
11
|
if caller_instance.instance_variable_defined?(:@__parameter_table)
|
13
12
|
table = caller_instance.instance_variable_get(:@__parameter_table)
|
@@ -21,42 +20,57 @@ module RSpec
|
|
21
20
|
row.add_param(other)
|
22
21
|
table
|
23
22
|
end
|
24
|
-
auto_inject_binding :|
|
25
23
|
end
|
26
24
|
|
27
25
|
module TableSyntax
|
28
|
-
|
29
|
-
|
30
|
-
|
26
|
+
if Gem::Version.create(RUBY_VERSION) >= Gem::Version.create("3.2.0.rc1")
|
27
|
+
refine Object do
|
28
|
+
import_methods TableSyntaxImplement
|
29
|
+
end
|
31
30
|
|
32
|
-
if Gem::Version.create(RUBY_VERSION) >= Gem::Version.create("2.4.0")
|
33
31
|
refine Integer do
|
34
|
-
|
32
|
+
import_methods TableSyntaxImplement
|
33
|
+
end
|
34
|
+
|
35
|
+
refine Array do
|
36
|
+
import_methods TableSyntaxImplement
|
37
|
+
end
|
38
|
+
|
39
|
+
refine NilClass do
|
40
|
+
import_methods TableSyntaxImplement
|
41
|
+
end
|
42
|
+
|
43
|
+
refine TrueClass do
|
44
|
+
import_methods TableSyntaxImplement
|
45
|
+
end
|
46
|
+
|
47
|
+
refine FalseClass do
|
48
|
+
import_methods TableSyntaxImplement
|
35
49
|
end
|
36
50
|
else
|
37
|
-
refine
|
51
|
+
refine Object do
|
38
52
|
include TableSyntaxImplement
|
39
53
|
end
|
40
54
|
|
41
|
-
refine
|
55
|
+
refine Integer do
|
42
56
|
include TableSyntaxImplement
|
43
57
|
end
|
44
|
-
end
|
45
58
|
|
46
|
-
|
47
|
-
|
48
|
-
|
59
|
+
refine Array do
|
60
|
+
include TableSyntaxImplement
|
61
|
+
end
|
49
62
|
|
50
|
-
|
51
|
-
|
52
|
-
|
63
|
+
refine NilClass do
|
64
|
+
include TableSyntaxImplement
|
65
|
+
end
|
53
66
|
|
54
|
-
|
55
|
-
|
56
|
-
|
67
|
+
refine TrueClass do
|
68
|
+
include TableSyntaxImplement
|
69
|
+
end
|
57
70
|
|
58
|
-
|
59
|
-
|
71
|
+
refine FalseClass do
|
72
|
+
include TableSyntaxImplement
|
73
|
+
end
|
60
74
|
end
|
61
75
|
end
|
62
76
|
end
|
data/lib/rspec/parameterized.rb
CHANGED
@@ -77,6 +77,7 @@ module RSpec
|
|
77
77
|
opts = args.last.is_a?(Hash) ? args.pop : {}
|
78
78
|
opts[:caller] = caller unless opts[:caller]
|
79
79
|
args.push(opts)
|
80
|
+
@parameter ||= nil
|
80
81
|
|
81
82
|
if @parameter.nil?
|
82
83
|
@parameterized_pending_cases ||= []
|
@@ -89,12 +90,11 @@ module RSpec
|
|
89
90
|
private
|
90
91
|
def set_parameters(arg_names, &b)
|
91
92
|
@parameter = Parameter.new(arg_names, &b)
|
93
|
+
@parameterized_pending_cases ||= []
|
92
94
|
|
93
|
-
|
94
|
-
@
|
95
|
-
|
96
|
-
}
|
97
|
-
end
|
95
|
+
@parameterized_pending_cases.each { |e|
|
96
|
+
define_cases(@parameter, *e[0], &e[1])
|
97
|
+
}
|
98
98
|
end
|
99
99
|
|
100
100
|
def define_cases(parameter, *args, &block)
|
data/rspec-parameterized.gemspec
CHANGED
@@ -9,11 +9,13 @@ Gem::Specification.new do |gem|
|
|
9
9
|
I was inspired by [udzura's mock](https://gist.github.com/1881139).}
|
10
10
|
gem.homepage = "https://github.com/tomykaira/rspec-parameterized"
|
11
11
|
|
12
|
+
gem.metadata["rubygems_mfa_required"] = "true"
|
13
|
+
|
12
14
|
gem.add_dependency('rspec', '>= 2.13', '< 4')
|
13
15
|
gem.add_dependency('parser')
|
14
16
|
gem.add_dependency('unparser')
|
15
17
|
gem.add_dependency('proc_to_ast')
|
16
|
-
gem.add_dependency('
|
18
|
+
gem.add_dependency('binding_of_caller')
|
17
19
|
gem.add_development_dependency('rake', '>= 12.0.0')
|
18
20
|
|
19
21
|
gem.files = `git ls-files`.split($\)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rspec-parameterized
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- tomykaira
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-12-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|
@@ -73,19 +73,19 @@ dependencies:
|
|
73
73
|
- !ruby/object:Gem::Version
|
74
74
|
version: '0'
|
75
75
|
- !ruby/object:Gem::Dependency
|
76
|
-
name:
|
76
|
+
name: binding_of_caller
|
77
77
|
requirement: !ruby/object:Gem::Requirement
|
78
78
|
requirements:
|
79
79
|
- - ">="
|
80
80
|
- !ruby/object:Gem::Version
|
81
|
-
version: 0
|
81
|
+
version: '0'
|
82
82
|
type: :runtime
|
83
83
|
prerelease: false
|
84
84
|
version_requirements: !ruby/object:Gem::Requirement
|
85
85
|
requirements:
|
86
86
|
- - ">="
|
87
87
|
- !ruby/object:Gem::Version
|
88
|
-
version: 0
|
88
|
+
version: '0'
|
89
89
|
- !ruby/object:Gem::Dependency
|
90
90
|
name: rake
|
91
91
|
requirement: !ruby/object:Gem::Requirement
|
@@ -132,7 +132,8 @@ files:
|
|
132
132
|
- spec/spec_helper.rb
|
133
133
|
homepage: https://github.com/tomykaira/rspec-parameterized
|
134
134
|
licenses: []
|
135
|
-
metadata:
|
135
|
+
metadata:
|
136
|
+
rubygems_mfa_required: 'true'
|
136
137
|
post_install_message:
|
137
138
|
rdoc_options: []
|
138
139
|
require_paths:
|
@@ -148,7 +149,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
148
149
|
- !ruby/object:Gem::Version
|
149
150
|
version: '0'
|
150
151
|
requirements: []
|
151
|
-
rubygems_version: 3.
|
152
|
+
rubygems_version: 3.4.0.dev
|
152
153
|
signing_key:
|
153
154
|
specification_version: 4
|
154
155
|
summary: RSpec::Parameterized supports simple parameterized test syntax in rspec.
|