rspec-parameterized 0.5.2 → 0.5.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b23f093e2fa9b8dbf2b3c4c3b04ce052ae73aa3dbe0d21cbb7a5e2e87f33a71d
4
- data.tar.gz: c5ebbcad0dc320e6142b23e4b1a5f259e58be61aabb968a1cf573e512c147647
3
+ metadata.gz: '0394579cf5005becd6e7b94186ea47ba37aee0440ea354483b4d2fde7acc2a24'
4
+ data.tar.gz: 7f0bcb5613a91aba4c460dea82ad59c603563c83f87e6b907816fbaa202b2934
5
5
  SHA512:
6
- metadata.gz: 2bdbe0fde4048954d88af8668938b7da13c58367282deeb7b1f0d096003abfb0ea8d4cc16880b972c962e2abb9962091ea33732665ab01a67dab3b53c97ce91e
7
- data.tar.gz: f2dce9cd68b028acb2912875160213f633324874c139bc1652e3bd43c4899515635f84429f765e4293c09e5f4ed917aa02740c85ce7eb865f0be9de7047281e2
6
+ metadata.gz: 744d46bd1d4180c2fc884681e95c84314593af287278a61eeeb0d3ceb1d4400a1d2322c35ae3bbcc74a5fc650e65c4d4e87c5fda0e03b6e87c7af63ab292adb8
7
+ data.tar.gz: f71bbf3fb4f4e7e35a6ab23e1d2be5f266abec76f3279af6dc5aeb75ac5bbc66c9ddd9368a7978bee54a099595cca26ac8bac29eda8cc5268492dac8115b79ae
@@ -11,7 +11,7 @@ jobs:
11
11
  runs-on: ubuntu-latest
12
12
  strategy:
13
13
  matrix:
14
- ruby-version: ['2.6', '2.7', '3.0', '3.1']
14
+ ruby-version: ['2.6', '2.7', '3.0', '3.1', '3.2']
15
15
 
16
16
  steps:
17
17
  - uses: actions/checkout@v2
data/CHANGELOG.md CHANGED
@@ -1,6 +1,15 @@
1
1
  # Change Log
2
2
  ## Unreleased
3
- [Full Changelog](https://github.com/tomykaira/rspec-parameterized/compare/v0.5.2...master)
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
4
13
 
5
14
  ## [v0.5.2](https://github.com/tomykaira/rspec-parameterized/tree/v0.5.2) (2022-06-24)
6
15
  [Full Changelog](https://github.com/tomykaira/rspec-parameterized/compare/v0.5.1...v0.5.2)
@@ -1,13 +1,12 @@
1
1
  require 'rspec/parameterized/table'
2
- require 'binding_ninja'
2
+ require 'binding_of_caller'
3
3
 
4
4
  module RSpec
5
5
  module Parameterized
6
6
  module TableSyntaxImplement
7
- extend BindingNinja
8
-
9
- def |(where_binding, other)
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
- refine Object do
29
- include TableSyntaxImplement
30
- end
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
- include TableSyntaxImplement
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 Fixnum do
51
+ refine Object do
38
52
  include TableSyntaxImplement
39
53
  end
40
54
 
41
- refine Bignum do
55
+ refine Integer do
42
56
  include TableSyntaxImplement
43
57
  end
44
- end
45
58
 
46
- refine Array do
47
- include TableSyntaxImplement
48
- end
59
+ refine Array do
60
+ include TableSyntaxImplement
61
+ end
49
62
 
50
- refine NilClass do
51
- include TableSyntaxImplement
52
- end
63
+ refine NilClass do
64
+ include TableSyntaxImplement
65
+ end
53
66
 
54
- refine TrueClass do
55
- include TableSyntaxImplement
56
- end
67
+ refine TrueClass do
68
+ include TableSyntaxImplement
69
+ end
57
70
 
58
- refine FalseClass do
59
- include TableSyntaxImplement
71
+ refine FalseClass do
72
+ include TableSyntaxImplement
73
+ end
60
74
  end
61
75
  end
62
76
  end
@@ -1,5 +1,5 @@
1
1
  module RSpec
2
2
  module Parameterized
3
- VERSION = "0.5.2"
3
+ VERSION = "0.5.3"
4
4
  end
5
5
  end
@@ -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
- if @parameterized_pending_cases
94
- @parameterized_pending_cases.each { |e|
95
- define_cases(@parameter, *e[0], &e[1])
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)
@@ -15,7 +15,7 @@ I was inspired by [udzura's mock](https://gist.github.com/1881139).}
15
15
  gem.add_dependency('parser')
16
16
  gem.add_dependency('unparser')
17
17
  gem.add_dependency('proc_to_ast')
18
- gem.add_dependency('binding_ninja', '>= 0.2.3')
18
+ gem.add_dependency('binding_of_caller')
19
19
  gem.add_development_dependency('rake', '>= 12.0.0')
20
20
 
21
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.2
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-06-24 00:00:00.000000000 Z
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: binding_ninja
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.2.3
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.2.3
88
+ version: '0'
89
89
  - !ruby/object:Gem::Dependency
90
90
  name: rake
91
91
  requirement: !ruby/object:Gem::Requirement
@@ -149,7 +149,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
149
149
  - !ruby/object:Gem::Version
150
150
  version: '0'
151
151
  requirements: []
152
- rubygems_version: 3.3.7
152
+ rubygems_version: 3.4.0.dev
153
153
  signing_key:
154
154
  specification_version: 4
155
155
  summary: RSpec::Parameterized supports simple parameterized test syntax in rspec.